Memo: Set the template attribute in the ASP. NET topic.

Source: Internet
Author: User

You can also set the template attribute of the control in asp.net. In the asp.net application of theme, we can easily change the layout, style, or appearance of the template control.

For example, for the login control, the. aspx page only needs to be defined as follows:

Copy to ClipboardReference: [www.bkjia.com] <asp: Login ID = "login1" runat = "server"> </asp: Login>

In the. skin file, we can set the layout of the login control. Of course, you can define any number of different la S and specify different skinids.

For example:

Copy to ClipboardReference: [www.bkjia.com] <asp: login runat = "server">
<LayoutTemplate>
<I> Please Enter your credentials: </I> <br/>
<Table>
<Tr>
<Td align = "right"> <asp: Label ID = "lblName" runat = "server" Text = "User Name:"> </asp: Label> </td>
<Td> <asp: TextBox ID = "Username" runat = "server"> </asp: TextBox> </td>
</Tr>
<Tr>
<Td align = "right"> <asp: Label ID = "lblPsw" runat = "server" Text = "Password:"> </asp: Label> </td>
<Td> <asp: TextBox ID = "Password" runat = "server" Textmode = "password"> </asp: TextBox> </td>
</Tr>
<Tr>
<Td colspan = "2" align = "center"> <asp: button ID = "btnLogin" runat = "server" Text = "Log In" CommandName = "Login"/> </td>
</Tr>
</Table>
<Asp: Literal ID = "FailureText" runat = "server" EnableViewState = "false"> </asp: Literal>
</LayoutTemplate>
</Asp: login>

This definition in. skin replaces the template content of the login control on the page.

Related Article

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.