The LoginAdapter and AdapterEnabled=”false”

Last post 07-16-2008 7:25 AM by stevebee77. 0 replies.

Sort Posts:

  • The LoginAdapter and AdapterEnabled=”false”

    07-16-2008, 7:25 AM
    • Loading...
    • stevebee77
    • Joined on 01-24-2007, 6:48 AM
    • Posts 6

    I was tinkering with using the LoginAdapter for my asp:Login control in VS2005 and experimenting with the AdapterEnabled=”false” attribute with a view to opting-out of using the adapter on certain pages.

     

    I found that when AdapterEnabled=”false”, the HTML always contains tags for the Login control’s Create User, Password Recovery and Help links – even though I haven’t defined them in the Login controls original markup.

     

    Even if create a simple adapter which does nothing but call its base methods, these tags still appear.

     

    However, if I stop using the adapter altogether (my removing it from my .browser file), the control is rendered correctly (without the superfluous tags).

     

    It seems that when an adapter is involved in the rendering process, the default markup is different than when no adapter is involved (or the adapter simply calls its base methods)

     

    Has anyone else had this issue?

     

     HTML without an adapter:

    1    <table cellspacing="0" cellpadding="1" border="0" id="ctl00_LoginContent_LoginView1_Login1" style="border-collapse:collapse;">
    2 <tr>
    3 <td>
    4 <table cellpadding="0" border="0">
    5 <tr>
    6 <td align="right">
    7 <label for="ctl00_LoginContent_LoginView1_Login1_UserName">Username</label>
    8 </td>
    9 <td>
    10 <input name="ctl00$LoginContent$LoginView1$Login1$UserName" type="text" id="ctl00_LoginContent_LoginView1_Login1_UserName" />
    11 <span id="ctl00_LoginContent_LoginView1_Login1_UserNameRequired" title="User Name is required." style="color:Red;visibility:hidden;">*</span>
    12 </td>
    13 </tr>
    14 <tr>
    15 <td align="right">
    16 <label for="ctl00_LoginContent_LoginView1_Login1_Password">Password</label>
    17 </td>
    18 <td>
    19 <input name="ctl00$LoginContent$LoginView1$Login1$Password" type="password" id="ctl00_LoginContent_LoginView1_Login1_Password" />
    20 <span id="ctl00_LoginContent_LoginView1_Login1_PasswordRequired" title="Password is required." style="color:Red;visibility:hidden;">*</span>
    21 </td>
    22 </tr>
    23 <tr>
    24 <td colspan="2">
    25 <input id="ctl00_LoginContent_LoginView1_Login1_RememberMe" type="checkbox" name="ctl00$LoginContent$LoginView1$Login1$RememberMe" />
    26 <label for="ctl00_LoginContent_LoginView1_Login1_RememberMe">Remember me.</label>
    27 </td>
    28 </tr>
    29 <tr>
    30 <td align="right" colspan="2">
    31 <input type="submit" name="ctl00$LoginContent$LoginView1$Login1$LoginButton" value="Log In" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$LoginContent$LoginView1$Login1$LoginButton", "", true, "ctl00$LoginContent$LoginView1$Login1", "", false, false))" id="ctl00_LoginContent_LoginView1_Login1_LoginButton" class="submit" />
    32 </td>
    33 </tr>
    34 </table>
    35 </td>
    36 </tr>
    37 </table>
    38

     HTML with adapter but with AdapterEnabled="false": Note lines 45-56 appear, even though original markup does not define anything for them. IE7 renders them as missing images.

    1    <table id="ctl00_LoginContent_LoginView1_Login1" AdapterEnabled="false">
    2 <table border="0" id="ctl00_LoginContent_LoginView1_Login1">
    3 <tr>
    4 <td>
    5 <table cellpadding="0" border="0">
    6 <tr>
    7 <td align="center" colspan="2"></td>
    8 </tr>
    9 <tr>
    10 <td align="center" colspan="2"></td>
    11 </tr>
    12 <tr>
    13 <td align="right">
    14 <label for="ctl00_LoginContent_LoginView1_Login1_UserName"></label>
    15 </td>
    16 <td>
    17 <input name="ctl00$LoginContent$LoginView1$Login1$UserName" type="text" id="ctl00_LoginContent_LoginView1_Login1_UserName" />
    18 <span id="ctl00_LoginContent_LoginView1_Login1_UserNameRequired" style="color:Red;visibility:hidden;">*</span>
    19 </td>
    20 </tr>
    21 <tr>
    22 <td align="right">
    23 <label for="ctl00_LoginContent_LoginView1_Login1_Password"></label>
    24 </td>
    25 <td>
    26 <input name="ctl00$LoginContent$LoginView1$Login1$Password" type="password" id="ctl00_LoginContent_LoginView1_Login1_Password" />
    27 <span id="ctl00_LoginContent_LoginView1_Login1_PasswordRequired" style="color:Red;visibility:hidden;">*</span>
    28 </td>
    29 </tr>
    30 <tr>
    31 <td colspan="2">
    32 <input id="ctl00_LoginContent_LoginView1_Login1_RememberMe" type="checkbox" name="ctl00$LoginContent$LoginView1$Login1$RememberMe" />
    33 </td>
    34 </tr>
    35 <tr>
    36 <td align="center" colspan="2"></td>
    37 </tr>
    38 <tr>
    39 <td align="right" colspan="2">
    40 <a id="ctl00_LoginContent_LoginView1_Login1_LoginLinkButton" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$LoginContent$LoginView1$Login1$LoginLinkButton", "", true, "ctl00$LoginContent$LoginView1$Login1", "", false, true))"></a>
    41 <input type="image" name="ctl00$LoginContent$LoginView1$Login1$LoginImageButton" id="ctl00_LoginContent_LoginView1_Login1_LoginImageButton" src="" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$LoginContent$LoginView1$Login1$LoginImageButton", "", true, "ctl00$LoginContent$LoginView1$Login1", "", false, false))" style="border-width:0px;" />
    42 <input type="submit" name="ctl00$LoginContent$LoginView1$Login1$LoginButton" value="" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$LoginContent$LoginView1$Login1$LoginButton", "", true, "ctl00$LoginContent$LoginView1$Login1", "", false, false))" id="ctl00_LoginContent_LoginView1_Login1_LoginButton" />
    43 </td>
    44 </tr>
    45 <tr>
    46 <td colspan="2">
    47 <img src="" style="border-width:0px;" />
    48 <a id="ctl00_LoginContent_LoginView1_Login1_CreateUserLink"></a>
    49 <br />
    50 <img src="" style="border-width:0px;" />
    51 <a id="ctl00_LoginContent_LoginView1_Login1_PasswordRecoveryLink"></a>
    52 <br />
    53 <img src="" style="border-width:0px;" />
    54 <a id="ctl00_LoginContent_LoginView1_Login1_HelpLink"></a>
    55 </td>
    56 </tr>
    57 </table>
    58 </td>
    59 </tr>
    60 </table>
    61 </table>
    62
      
Page 1 of 1 (1 items)
Microsoft Communities
Page view counter