怎样风格的CSS asp.net成员控制? [英] How do I style the asp.net membership control with css?
本文介绍了怎样风格的CSS asp.net成员控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何风格的CSS asp.net成员控制?我喜欢把不同类别上的用户名文本框,密码文本框,以及登录按钮。
How do I style the asp.net membership control with css? I'd like to put different classes on the username textbox, the password textbox, and the login button.
推荐答案
您有两种选择。
首先 - 给登录
控制一些类,并使用CSS选择器来访问样式其内部控制的:
First - give the Login
control some class and use css selectors to access styles of its inner controls:
ASPX:
<asp:Login ID="Login2" runat="server" EnableViewState="true" CssClass="login">
CSS:
.login input[type="text"] {...} /*username*/
.login input[type="password"] {...} /*password*/
.login input[type="submit"] {...} /*submit button*/
二 - 定义你自己的登录
控制和使用任何你需要的类模板
Second - define you own template for the Login
control and use whatever classes you need.
ASPX:
<asp:Login ID="LoginUser" runat="server" EnableViewState="false" RenderOuterTable="false">
<LayoutTemplate>
...
<asp:TextBox ID="UserName" runat="server" CssClass="username" />
...
<asp:TextBox ID="Password" runat="server" CssClass="password" TextMode="Password" />
...
<asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="LoginUserValidationGroup" CssClass="submitButton"/>
...
</LayoutTemplate>
</asp:Login>
这篇关于怎样风格的CSS asp.net成员控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文