Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Login control with layout template

Login control with layout template

Login control with layout template

I have a login control with a layout template.  I have read that AJAX should work with a partial page update but mine is not working.  It does a full postback.

Here is my code:


<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <asp:LoginView ID="LoginView1" runat="server">
      <asp:Login ID="Login1" runat="server" Width="200px" >
        <asp:Label ID="Label1" runat="server" AssociatedControlID="UserName">User Name:</asp:Label><br />
        <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="ctl00$ctl01$Login1" EnableClientScript="False">*</asp:RequiredFieldValidator><br />
        <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label><br />
        <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="ctl00$ctl01$Login1" EnableClientScript="False">*</asp:RequiredFieldValidator><br />
        <asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time." /><br />
        <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal><br />
        <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="ctl00$ctl01$Login1" />
        Welcome <asp:LoginName ID="LoginName1" runat="server" Font-Bold="True" /><br /><br />
       Add Photos<br />
        <asp:LoginStatus ID="LoginStatus1" runat="server" />

RE: Login control with layout template

Set the UpdateMode="Conditional" in the UpdatePanel.


"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach

RE: Login control with layout template

I understand that making that change will prevent the update panel from updating unless certain conditions are met but why would a button within that panel be affected by that when the button would cause some type of postback anyway in either setting?

RE: Login control with layout template

The UpdateMode property of the UpdatePanel can be set to either Always or Conditional, but if neither are supplied it will default to Always.  When the value is Always, a postback from any other control on the page will cause the contents of the panel to be updated.  If the control that causes the post-back was marked as an asynchronous post-back trigger, only the contents of the panel is updated, otherwise the complete page - including the panel is updated.

Source: http://mattberseth.com/blog/2007/07/indepth_the_updatepanel_aspnet.html]


"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach

RE: Login control with layout template

That makes a lot of sense.  Based on that, the login button in the panel should only post back the panel, correct?

RE: Login control with layout template

Based on that, my code above shows it setup exactly like that.  I have my update panel (no nested panels) the login button is in the update panel and clicking that button causes a full postback, not just an async postback.

I understand what changing the setting to conditional will do but the full post back is happening from within the updatepanel.  My understanding is that this should only be a partial update by clicking that button inside the update panel.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close