CSS Friendly ASP. NET 2.0 Control Adapters (Beta 2.0) a Bug in URL Processing

Source: Internet
Author: User
Developed with CSS Friendly ASP. NET 2.0 Control Adapters (Beta 2.0)

For example, in the login control, CreateUserUrl = "~ /Secure/NewUserReg. aspx "and PasswordRecoveryUrl = "~ /Secure/PasswordRecovery. aspx"

1 <asp: Login ID = "Login1" runat = "server" CreateUserText = "New User Registration" CreateUserUrl = "~ /Secure/NewUserReg. aspx"
2 Width = "232px" OnLoggingIn = "loginlogs loggingin" PasswordRecoveryText = "forgot password" PasswordRecoveryUrl = "~ /Secure/PasswordRecovery. aspx ">
3 </asp: Login>

After running the parsing code, note the code in the red background. The Url is not converted here (the green part is the running result after I modified WriteCreateUserPanel ),:

1 <div class = "AspNet-Login">
2 <div class = "AspNet-Login-TitlePanel">
3 <span> logon </span>
4 </div>
5 <div class = "AspNet-Login-UserPanel">
6 <label for = "ctl00_ContentPlaceHolderMain_Login1_UserName"> User name: </label>
7 <input type = "text" id = "ctl00_ContentPlaceHolderMain_Login1_UserName" name = "ctl00 $ ContentPlaceHolderMain $ Login1 $ UserName" value = ""/> <span id = "regular" style =" color: red; visibility: hidden; "> * </span>
8 </div>
9 <div class = "AspNet-Login-PasswordPanel">
10 <label for = "ctl00_ContentPlaceHolderMain_Login1_Password"> password: </label>
11 <input type = "password" id = "ctl00_ContentPlaceHolderMain_Login1_Password" name = "ctl00 $ ContentPlaceHolderMain $ Login1 $ Password" value = ""/> <span id = "regular" 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"> remember me next time. </Label>
16 </div>
17 <div class = "AspNet-Login-SubmitPanel">
18 <input type = "submit" value = "login" id = "ctl00_ContentPlaceHolderMain_Login1_LoginButton" name = "ctl00 $ ContentPlaceHolderMain $ Login1 $ LoginButton" onclick = "javascript: configure (new WebForm_PostBackOptions (& quot; ctl00 $ ContentPlaceHolderMain $ Login1 $ LoginButton & quot;, & quot;, true, & quot; ctl00 $ ContentPlaceHolderMain $ Login1 & quot ;, & quot;, false, false) "/>
19 </div>
20 <div class = "AspNet-Login-CreateUserPanel">
21 <a href = "/web/Secure/NewUserReg. aspx" title = "Create user"> New user Registration </a>
22 </div>
23 <div class = "AspNet-Login-PasswordRecoveryPanel">
24 <a href = "~ /Secure/PasswordRecovery. aspx "title =" Password recovery "> forgot Password </a>
25 </div>
26 </div>

The code for modifying WriteCreateUserPanel in LoginAdapter. cs is as follows: 1 private void WriteCreateUserPanel (HtmlTextWriter writer, Login login)
2 {
3 if (login. CreateUserUrl. Length> 0) | (login. CreateUserText. Length> 0 ))
4 {
5 WebControlAdapterExtender. WriteBeginDiv (writer, "AspNet-Login-CreateUserPanel ");
6 WebControlAdapterExtender. WriteImage (writer, login. CreateUserIconUrl, "Create user ");
7 // WebControlAdapterExtender. WriteLink (writer, login. HyperLinkStyle. CssClass, login. CreateUserUrl, "Create user", login. CreateUserText );
8 WebControlAdapterExtender. WriteLink (writer, login. HyperLinkStyle. CssClass, Page. ResolveUrl (login. CreateUserUrl), "Create user", login. CreateUserText );
9 WebControlAdapterExtender. WriteEndDiv (writer );
10}
11}

Similar changes to other controls

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.