Use of placefolder

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.