提交页面.就是相当于asp的form.submit();只不过加了些参数
<form   id= "form1 "   runat= "server " > 
        
<div > 
                
<br   > 
                
<input   type= "button "   onclick= "javascript:__doPostBack( &apos;Button1 &apos;, &apos;haha &apos;) "   style= "width:   245px "   / > 
                
<br   > 
                
<asp:Button   ID= "Button1 "   runat= "server "   Text= "Button "   OnClick= "Button1_Click "   Height= "10px "   Width= "10px "   / > 
                
<asp:LinkButton   ID= "LinkButton1 "   runat= "server " > </asp:LinkButton > </div > 
        
</form > 

protected   void   Button1_Click   (   object   sender   ,   EventArgs   e   ) 
                { 
                        //__EVENTTARGET 
                        string   tag   =   (   Request[ "__EVENTTARGET "]   ==   null   )   ?   " "   :   Convert.ToString(   Request[ "__EVENTTARGET "]   ); 
                        //__EVENTARGUMENT 
                        string   arg   =   (   Request[ "__EVENTARGUMENT "]   ==   null   )   ?   " "   :   Convert.ToString(   Request[ "__EVENTARGUMENT "]   ); 
                        Response.Write(   " 
<br> "   +   tag   +   " <br> "   +   arg   ); 
                }
你注意只要你的页面加了LinkButton,其客户端脚本就会有__doPostBack函数

这个时候,你可以用   __doPostBack( "服务器控件名 ", " ")来提交页面并调用其服务器端方法
posted on 2007-12-12 09:39  小角色  阅读(497)  评论(0)    收藏  举报