I have some html fragment in memory that I need to do with RenderAction. For example, my action method looks something like this:
var html = "some HTML
How do I render this html using RenderAction, I donβt want to create a view file because it is a dynamic html. And I can not use any of the results of the file, because it does not come from the file. What other ways to do this?
Check ContentViewResultor shortcutreturn Content(string html)
ContentViewResult
return Content(string html)
Immediately I can present two options:
1) You can read this HTML line in the stream and then return it through FileResult (stream, "text/html")
FileResult (stream, "text/html")
2) HTML <%= Model.MyDynamicHtml %>
<%= Model.MyDynamicHtml %>
1), , .
Source: https://habr.com/ru/post/1761323/More articles:How to vectorize this operation for each row of the matrix - rHow does verbose forms debugging allow classes in eclipse? - javaTips for manually managing the sustainability context - javaDependency injection problem with EntityManagerFactory + jpadaosupport - javaconstructors and destructors - C ++ - c ++https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1761324/using-blocks-to-define-abilities-in-cancan-raises-an-exception&usg=ALkJrhixriX42UD7YtdIp7oQv7OdvUbJEADynamic proxy lock and INotifyPropertyChanged in WPF - c #Call lex / yacc from a separate program - flex-lexerContextMenuStrip In RightClick IF elements selected in the list? - c #Internal function cannot be defined (C) - cAll Articles