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=
Ïà¹ØÎĵµ£º
ajax Detail.aspxÒ³Ãæ
protected void Page_Load(object sender, EventArgs e)
{
Thread.Sleep(500);
string Keyid = Request.QueryString["Id"].ToString();
......
HTML´úÂ룺
<script language="javascript" event="onclick" for="ImageButton1">
return confirm('È·¶¨Òª±£´æ±ä¸üÂð£¿');//·µ»Øfalseʱ²»Ö´ÐÐImageButton1_Click·½·¨£¬·µ»ØtureʱִÐÐImageButton1_Click·½·¨
</script>
<asp:ImageButton ID="ImageButton1" runat="server" ImageAlig ......
@import url(¡°layout.css¡±)
CSS Selectors: *, p, div span, div > span, *[href], li+li, .title, #container, #title p:first-child, a:link, a:hover, a:visited, p:before, p:after
p:after{content:¡¯url(images/quote.gif)¡¯}
!important State Mode: Off, InProc, StateServer, SQLServer, C ......
Request¶ÔÏó¹¦ÄÜÊÇ´Ó¿Í»§¶ËµÃµ½Êý¾Ý£¬³£ÓõÄÈýÖÖÈ¡µÃÊý¾ÝµÄ·½·¨ÊÇ£ºRequest.Form¡¢Request.QueryString£¬Request¡£ÆäµÚÈýÖÖÊÇǰÁ½ÖÖµÄÒ»¸öËõд£¬¿ÉÒÔÈ¡´úǰÁ½ÖÖÇé¿ö¡£¶øÇ°Á½ÖÖÖ÷Òª¶ÔÓ¦µÄFormÌύʱµÄÁ½ÖÖ²»Í¬µÄÌá½»·½·¨£º·Ö±ðÊÇPost·½·¨ºÍGet·½·¨¡£
Request ¶ÔÏóµÄÊôÐԺͷ½·¨± ......