problem with Firefox

N

Nariban Barkan

I am using this code for preventing double click to button (btnInsert), i
add this on Page_Load event.
********************************
StringBuilder sb = new StringBuilder();
sb.Append("if (typeof(Page_ClientValidate) == 'function') { ");
sb.Append("if (Page_ClientValidate() == false) { return false; }} ");
sb.Append("this.value = Please Wait...';");
sb.Append("this.disabled = true;");
sb.Append(this.Page.ClientScript.GetPostBackEventReference(this.btnInsert,
""));
sb.Append(";");
this.btnInsert.Attributes.Add("onclick", sb.ToString());
********************************

It works fine with IE 7 and Safari browsers but Firefox causes
btnInsert_Click event two times..

In btnInsert_Click event, i insert a data to database, and if user has
firefox , same data inserted twice for one button click.

Thank you for any help.

DL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top