I have an ASP button that when clicked brings up a window.confirm
. This window.confirm
disappears without user interaction. However, if I keep clicking the ASP button, after about the 4th or 5th click the window.confirm
box will work as expected.
A couple of things that I also noticed, after hours of working on it, if I remove the Text
property from the ASP button, the window.confirm
works as it should.
This made me think, "Hmmmm... let me look at the <input>
button that is behind the scenes of the ASP button, and I noticed that if I remove the value from the input the window.confirm
works, but if I put a value in the input, the window.confirm stops working again.
Does anyone know what may cause this? Is there a work around to putting text in the button without using the Text property? I haven't tried innerHTML yet because I wanted to see if there is anything else I can do before I do that.
Btw, I tried using OnClientClick
, instead of OnClick
and I get the same results.
Here is the code that I have for the button:
<asp:Button ID="btSubmit" runat="server" Text ="Submit Email" OnClick="btSubmit_Click" OnClientClick="return confirm('Test');"/>