views:

45

answers:

1

I have an image button that when clicked the first time it just seems to submit the page like an old classic asp button. However, after the submit the button's code is executed. Any idea what can cause this?

 <asp:Button ID="bttnfinal"  style="cursor:pointer;display:none" CausesValidation="false" OnClientClick="return true;" runat="server" 
                    Text="Finalization Page" onclick="bttnfinal_Click" />

I know this may not be a sufficient amount of code but i really don't know where to start when it comes to showing code for this issue.

+3  A: 

What are you doing in the rest of the page code? I have seen similar issues pop up in some ASP.NET stuff we have worked on, and many times something in page_load was interrupting the events. Remember that page_load runs before any event handlers, so if you are doing anything up there that tweaks with the button -- you may end up canceling the click event. I have no idea if that's what's happening to you, I just know that I've this same presentation several times and that ended up being the cause.

David Hay
Thank you David. You saying this made me re-analyze my page load code. I was setting the button there to visible or invisible. Instead i set the style to not display and i do this on pagesavecomplete.
Eric