It’s time to make New Year resolutions. So what it’s going to be for this year?
Loose weight
Save more money
Spend more quality time with family
Find a better job etc. ????????????
How many of you remember, what was your last year New Year resolutions? (If you forgot last year, please write it down somewhere for this year ;). Setting goals always good but living your life to the expectations always tough.
Wish you all great year 2008 (of course with all of your new year's resolutions to come true)
Loose weight
Save more money
Spend more quality time with family
Find a better job etc. ????????????
How many of you remember, what was your last year New Year resolutions? (If you forgot last year, please write it down somewhere for this year ;). Setting goals always good but living your life to the expectations always tough.
Wish you all great year 2008 (of course with all of your new year's resolutions to come true)
One of the problems with web forms is when user clicks on Submit button several times, it will do multiple submissions. To prevent this we can easily use client side script to disable the Submit button. But then next problem you face after disabling the Submit button is to do the PostBack (after disabling the Submit button it stops the page PostBack happens).
I came across an article which shows how you can get around this problem by calling a client side function. Hope this would help you guys if facing the same problem like I did.
client side function (Page_DoPostBack) as follows
System.Text.StringBuilder sbValid = new System.Text.StringBuilder();
sbValid.Append("if (typeof(Page_DoPostBack) = = 'function') { ");
sbValid.Append("if (Page_DoPostBack () == false) { return false; }} ");
sbValid.Append("this.disabled = true;");
sbValid.Append("document.all.btnSubmit.disabled = true;");
//GetPostBackEventReference obtains a reference to a client-side script function that causes the server to post back to the page.
sbValid.Append(this.Page.GetPostBackEventReference(this.btnSubmit));
sbValid.Append(";");
this.btnSubmit.Attributes.Add("onclick", sbValid.ToString());
I came across an article which shows how you can get around this problem by calling a client side function. Hope this would help you guys if facing the same problem like I did.
client side function (Page_DoPostBack) as follows
System.Text.StringBuilder sbValid = new System.Text.StringBuilder();
sbValid.Append("if (typeof(Page_DoPostBack) = = 'function') { ");
sbValid.Append("if (Page_DoPostBack () == false) { return false; }} ");
sbValid.Append("this.disabled = true;");
sbValid.Append("document.all.btnSubmit.disabled = true;");
//GetPostBackEventReference obtains a reference to a client-side script function that causes the server to post back to the page.
sbValid.Append(this.Page.GetPostBackEventReference(this.btnSubmit));
sbValid.Append(";");
this.btnSubmit.Attributes.Add("onclick", sbValid.ToString());