在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
例如在登陆控件,指定了CreateUserUrl="~/Secure/NewUserReg.aspx"和PasswordRecoveryUrl="~/Secure/PasswordRecovery.aspx"
1 <asp:Login ID="Login1" runat="server" CreateUserText="新用户注册" CreateUserUrl="~/Secure/NewUserReg.aspx"
2 Width="232px" OnLoggingIn="Login1_LoggingIn" PasswordRecoveryText="密码忘记" PasswordRecoveryUrl="~/Secure/PasswordRecovery.aspx"> 3 </asp:Login> 在运行后解析代码如下请注意红色背景处代码,这里对Url没有转换(绿色部分是我将WriteCreateUserPanel修改后的运行结果),:
1 <div class="AspNet-Login"> LoginAdapter.cs进行修改中的WriteCreateUserPanel部分修改代码如下:2 <div class="AspNet-Login-TitlePanel"> 3 <span>登录</span> 4 </div> 5 <div class="AspNet-Login-UserPanel"> 6 <label for="ctl00_ContentPlaceHolderMain_Login1_UserName">用户名:</label> 7 <input type="text" id="ctl00_ContentPlaceHolderMain_Login1_UserName" name="ctl00$ContentPlaceHolderMain$Login1$UserName" value="" /><span id="ctl00_ContentPlaceHolderMain_Login1_UserNameRequired" style="color:Red;visibility:hidden;">*</span> 8 </div> 9 <div class="AspNet-Login-PasswordPanel"> 10 <label for="ctl00_ContentPlaceHolderMain_Login1_Password">密码:</label> 11 <input type="password" id="ctl00_ContentPlaceHolderMain_Login1_Password" name="ctl00$ContentPlaceHolderMain$Login1$Password" value="" /><span id="ctl00_ContentPlaceHolderMain_Login1_PasswordRequired" style="color:Red;visibility:hidden;">*</span> 12 </div> 13 <div class="AspNet-Login-RememberMePanel"> 14 <input type="checkbox" id="ctl00_ContentPlaceHolderMain_Login1_RememberMeCheckBox" name="ctl00$ContentPlaceHolderMain$Login1$RememberMeCheckBox" /> 15 <label for="ctl00_ContentPlaceHolderMain_Login1_RememberMeCheckBox">下次记住我。</label> 16 </div> 17 <div class="AspNet-Login-SubmitPanel"> 18 <input type="submit" value="登录" id="ctl00_ContentPlaceHolderMain_Login1_LoginButton" name="ctl00$ContentPlaceHolderMain$Login1$LoginButton" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolderMain$Login1$LoginButton", "", true, "ctl00$ContentPlaceHolderMain$Login1", "", false, false))" /> 19 </div> 20 <div class="AspNet-Login-CreateUserPanel"> 21 <a href="/web/Secure/NewUserReg.aspx" title="Create user">新用户注册</a> 22 </div> 23 <div class="AspNet-Login-PasswordRecoveryPanel"> 24 <a href="~/Secure/PasswordRecovery.aspx" title="Password recovery">密码忘记</a> 25 </div> 26 </div>
1 private void WriteCreateUserPanel(HtmlTextWriter writer, Login login) 其他控件的修改雷同
2 } |
请发表评论