Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is the second time im putting this question online. Sorry for that but I still cant get a way to fire a button event inside an update panel;
ASP.NET
ID="UpdatePanel3" runat="server" UpdateMode="Always">
       <ContentTemplate>
           <asp:Panel ID="Panel3" runat="server" CssClass="HellowWorldPopup">

           <legend style="font-family: Tahoma; font-size: small; font-weight: bold; font-style: normal; font-variant: normal; text-transform: none; color: #000000; text-decoration: blink"> ICT UNAUTHORIZED USER
      </legend>
               <asp:Button ID="Button3" runat="server" Text="Button"  Style="display:none" />
               <asp:Button ID="Button4" runat="server" Text="OK" onclick="Button4_Click"
                   CausesValidation="true"/>
               <asp:Label ID="Label7" runat="server" Text="Label"></asp:Label>
               &nbsp;</asp:Panel>
           <asp:ModalPopupExtender ID="ModalPopupExtender12" runat="server" PopupControlID="Panel3" Enabled="true"
               TargetControlID="Button3">
           </asp:ModalPopupExtender>

       </ContentTemplate>
       <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button4" EventName="Click" />


          </Triggers>
   </asp:UpdatePanel>

I really dont know what the issue is and need some real help now please....

then in C# :
C#
protected void Button4_Click(object sender, EventArgs e)
    {
        Response.Redirect("Login.aspx");
    }
Posted
Updated 23-Sep-12 11:22am
v2
Comments
aajeesh 24-Sep-12 0:18am    
Dear harrypsd1789 Yuor code works fine for me..

Have you handled/defined validating event?
control causes validation and might be possible u didn't handle this.

try to execute without
CausesValidation="true"
or with
CausesValidation="false"
and see.
 
Share this answer
 
have checked with
C#
UpdateMode="Conditional"

then trigger will works
and also check the
click event name
C#
OnClick
 
Share this answer
 
v2
Comments
Kishor Khatri 5-Sep-14 6:53am    
Thanks S.P.Tiwari...
Its Worked for me...
Thanks for your answer or help
your code works for me, just try to use a hyperlink instead of a button & then link that login.aspx to that hyperlink
 
Share this answer
 
Comments
sanjayjaiswal 28-Apr-15 2:29am    
CausesValidation="false" is working for me..
Thanks a lot for this help..it saves a lot to me....I was struggling for a day for fixing this kind of issue...
 
Share this answer
 
Comments
Deepu S Nair 28-Apr-15 3:07am    
Don't post your comment as solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900