My solution as follows:
1 Protected Void Page_load ( Object Sender, eventargs E)
2 {
3 Postbackoptions options = New Postbackoptions (button1, String . Empty );
4
5 Stringbuilder sb = New Stringbuilder ();
6 If (Button1.causesvalidation && This . Getvalidators (button1.validationgroup). Count > 0 )
7 {
8 Options. clientsubmit = True ;
9 Options. Validate mvalidation = True ;
10 Options. validationgroup = Button1.validationgroup;
11
12 SB. append ( " If (typeof (page_clientvalidate) = 'function ') " );
13 SB. append ( " If (page_clientvalidate (\ "" + Button1.validationgroup + " \ " ) = False) return false; " );
14 }
15 If ( ! String . Isnullorempty (button1.postbackurl ))
16 Options. actionurl = Httputility. urlpathencode (button1.resolveclienturl (button1.postbackurl ));
17
18 SB. append ( " This. Disabled = true; " );
19 SB. append (clientscript. getpostbackeventreference (options ));
20 SB. append ( " ; " );
21 Button1.attributes. Add ( " Onclick " , SB. tostring ());
22 }
Is this one work well in your project?
Waiting for your comment, and share your experience with me on this topic is appreciated.