Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my project, a page has a submit button4. This button4 works only at the second click.
The breakpoint also works only on the second click.

Hereunder is my code:

XML
<asp:UpdatePanel ID = "UpdatePanel1" runat="server"  >
<ContentTemplate>
<asp:Button ID="Button4" runat="server" CausesValidation="false"
 onclick="Button4_Click"
        style="z-index: 1; left: 185px; top: 2840px; position: absolute;  background-color:InactiveBorder;  " ForeColor="Red" Text="Submit" />
  <asp:Button ID="Button5" runat="server"
        onclick="Button5_Click" CausesValidation="false"
        style="z-index: 1; left: 300px; top: 2840px; position: absolute;background-color:InactiveBorder; " ForeColor="Red" Text="Cancel" />
</ContentTemplate>
</asp:UpdatePanel>


Can anyone help me out.
Regards.
Posted
Comments
Chinmaya C 29-Apr-13 3:12am    
It should not behave like that. Can you please try after removing CauasesValidation attribute from button tag.
KM Perumal 29-Apr-13 4:38am    
can u post u code behind Button4_Click event
Mike Meinz 29-Apr-13 4:56am    
After you resolve this issue, please consider disabling the button upon first click. That prevents double-click by the user causing your code to run twice.

try these:

set update mode to conditional.
and set trigger of update panel
 
Share this answer
 
Hi,
The problem is with your Button4_Click event. Check the Code in the event. If any problem persist please contact.


Thanks.
 
Share this answer
 
Comments
Tiwari Avinash 29-Apr-13 4:27am    
yup! it may
Jαved 29-Apr-13 5:00am    
Have you solved it? or else add the code here so i can check it for you.
Hi Rajendran,

I hope cause validation property in the button control is making this weird things to happen.
Try refering this link
Link[^]

Once you clicked validation is set to true so it is allowing to work on the second click I believe.

Regards,
RK
 
Share this answer
 
REMOVE UPDATE PANEL OR SET TRIGGER FOR NEXT BUTTON
 
Share this answer
 

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