asp.netÔÚÓÃajaxµÄʱºòÈçºÎµ¯³ö¶Ô»°¿ò
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:updatepanel ID="UP" runat="server">
<ContentTemplate>
<asp:Button runat="server" Text="Button" onclick="Unnamed2_Click" />
</ContentTemplate>
</asp:updatepanel>
</div>
</form>
ASP.NET2.0ÖÐAJAXʹÓÃеÄManager ÀàÀ´¹ÜÀí£¬¶ø²»¼æÈÝÔÀ´µÄ ClientManager Àà ,ËùÒÔÓÃresponse.write("<script>alert('Ìáʾ£ºµãÎÒÁË!')</script>")ºÍ
this.Client.RegisterClientBlock(this.GetType(), "name", "<>alert('Ìáʾ£ºµãÎÒÁË!');</>", true);
Page.Client.RegisterClientBlock(this.GetType(), "name", "<>alert('Ìáʾ£ºµãÎÒÁË!);</>", true);
ÕâЩ·½·¨¶¼ÊÇÎÞЧµÄ.
¿ÉÒÔÓÃÒÔÏ·½·¨Ð´´úÂëʵÏÖ
ScriptManager.RegisterStartupScript(UP, UP.GetType(), "", "alert('µãÎÒÁË');", true);
ÕâÑù¾Í¿ÉÒÔʵÏÖÁË!
//UPÊÇupdatepanel µÄID
ת×Ôhttp://www.csharp360.com/bbs/viewthread.php?tid=233&extra=
Ïà¹ØÎĵµ£º
Ò³Ãæ´úÂ룺
<head runat="server">
<title>ÎÞ±êÌâÒ³</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManage ......
ÔÚ¡¶Pragmatic Ajax A Web 2.0 Primer ¡·ÖÐżȻ¿´µ½¶ÔreadyStae״̬µÄ½éÉÜ£¬¸Ð¾õÕâ¸ö½éÉܺÜʵÔÚ£¬ÕªÒëÈçÏ£º
0: (Uninitialized) the send( ) method has not yet been invoked.
1: (Loading) the send( ) method has been invoked, request in progress.
2: (Loaded) the send( ) method has completed, entire respons ......
Èç¹û²âÊÔµÄurlµØÖ·ÊÇhttp : //www.test.com/testweb/default.aspx, ½á¹ûÈçÏ£º
Request.ApplicationPath: /testweb
Request.CurrentExecutionFilePath: /testweb/default.aspx
Request.FilePath: /testweb/default.aspx
Request.Path: /testweb/default.aspx
Request.PhysicalApplicationPath: E:\WWW\testwebReq ......
ÌâÍâ»°£ºÈ¥ÄêÖÁ½ñÄêÒÔÀ´£¬Â½ÐøÐ´¹ýһЩԴ´µÄÎÄÕÂÁË£¬ºÜ¶àÊǶÔÔÀ´Ëù×öÏîÄ¿µÄ×ܽᡣËùÒÔ²¢²»ÊǺÜϵͳºÜÈ«Ãæ£¬¶¼ÊÇÕë¶Ôij¸ö֪ʶµã»òÕßij¸ö¾ßÌåÓ¦ÓÃдµÄ£¬ÓÐЩÅóÓѽ¨ÒéÎÒ°Ñ×Ô¼ºµÄÌå»áд³ÉÒ»¸öϵͳµÄ£¬Õâ´ÎËãÊÇÒ»¸ö³¢ÊÔ°É£¬Ð´µÃ²»ºÃµÄµØ·½Çë´ó¼Ò¾¡Á¿Å×Î÷ºìÊÁ²»Òª¶ª×©Í·¡£
Ö®ËùÒÔ°ÑÕâ¸öϵÁнÐ×ö¡¶asp.netÒ¹»°¡·£¬ÊÇÓÐһЩÔÒ ......