My English is very awesome, so I can not understand the obvious
This is the controller
This is the view , this is a template. & lt;% = ViewData [" Author "]%>
Public Class Home Controller: Controller {Public Action Result Index () {View Data ["Message"] = "Hello ASP.NET MVC! "; See Data ["Author"] = "Author: Alex"; See Return (); }
& asp: Content ID = "Content1" content placeholder id = "title content" runat = "server" & gt; Title & lt;%: View Data ["Message"]%>
I use this template Want to generate the HTML file.
Alex
By generating HTML, I assume that you have programmatic meaning and are not referring to those scenes, which you can definitely put in HTML.
In the html assistant or controller, you can use the tagbilder to generate HTML. For example ..
Tagbilder Tag = New Tag Creator ("IMG"); Tag.Attributes.Add ("id", "myImage"); Tag Features. Add ("src", "/ content / images / soma_image"); Tag a quality. Add ("alt", "my image"); Tag a quality. Add ("width", "300"); Tag a quality. Add ("height", "300"); String html = tag. Toasting (); You can also use HtmlTextWriter which is a bit similar.
HtmlTextWriter author = new HtmlTextWriter (stream); Author.RenderBuginTag (HtmlTextWriterTag.Ul) // Dome Some Goods Writer.Renderendag (); etc.
Comments
Post a Comment