You can place some values that need to be dynamically generated by the C # program in HTML.And you can insert HTML code snippets into it.
It is extremely nice to use its powerful functions, especially for pages with aspx + HTML mixed layout.
<% @ Page Language = "C #" %>
<% @ Import namespace = "system. Data" %>
<Script language = "C #" runat = "server">
Public void page_load (Object OBJ, eventargs E)
{
// Create a server control.
// The specified tag "Link" initializes a new instance of this type.
Htmlgenericcontrol objlink = new htmlgenericcontrol ("Link ");
Objlink. ID = ID;
Objlink. attributes ["rel"] = "stylesheet ";
Objlink. attributes ["type"] = "text/CSS ";
Objlink. attributes ["href"] = "portal.css ";
// This control does not produce any visible output. It is only used as a container for other controls. You can add, insert, or remove controls in it.
Mycss. Controls. Add (objlink );
}
</SCRIPT>
<HTML>
<Head>
<Title> C # </title>
<Asp: placeholder id = "mycss" runat = "server"> </ASP: placeholder>
</Head>
<Body bgcolor = "# ffcc66" style = "Font: 9pt">
<Form runat = "server">
</Form>
</Body>
</Html>