ASP.NETÖг£ÓõÄÈýÊ®ÈýÖÖ´úÂë
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý [·µ»ØÄ¿Â¼]
´«ËͲÎÊý£º
response.write("£¼script£¾window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')£¼/script£¾")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò [·µ»ØÄ¿Â¼]
Button1.Attributes.Add("onclick","return confirm('È·ÈÏ?')");
button.attributes.add("onclick","if(confirm('are you sure...?')){return true;}else{return false;}")
3.ɾ³ý±í¸ñÑ¡¶¨¼Ç¼ [·µ»ØÄ¿Â¼]
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex];
string deleteCmd = "Delete from Employee where emp_id = " + intEmpID.ToString()
4.ɾ³ý±í¸ñ¼Ç¼¾¯¸æ [·µ»ØÄ¿Â¼]
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e)
{
¡¡switch(e.Item.ItemType)
¡¡{
case ListItemType.Item :
case ListItemType.AlternatingItem :
case ListItemType.EditItem:
¡¡TableCell myTableCell;
¡¡myTableCell = e.Item.Cells[14];
¡¡LinkButton myDeleteButton ;
¡¡myDeleteButton = (LinkButton)myTableCell.Controls[0];
¡¡myDeleteButton.Attributes.Add("onclick","return confirm('ÄúÊÇ·ñÈ·¶¨ÒªÉ¾³ýÕâÌõÐÅÏ¢');");
¡¡break;
default:
¡¡break;
¡¡}
}
5.µã»÷±í¸ñÐÐÁ´½ÓÁíÒ»Ò³ [·µ»ØÄ¿Â¼]
private void grdCustomer_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
¡¡//µã»÷±í¸ñ´ò¿ª
¡¡if (e.Item.ItemType == ListItemType.Item e.Item.ItemType == ListItemType.AlternatingItem)
e.Item.Attributes.Add("onclick","window.open('Default.aspx?id=" + e.Item.Cells[0].Text + "');");
}
Ë«»÷±í¸ñÁ¬½Óµ½ÁíÒ»Ò³
ÔÚitemDataBindʼþÖÐ
if(e.Item.ItemType == ListItemType.Item e.Item.ItemType == ListItemType.AlternatingItem)
{
¡¡string orderItemID =e.item.cells[1].Text;
¡¡...
¡¡e.item.Attributes.Add("ondblclick", "locat
Ïà¹ØÎĵµ£º
×î½üÏë°Ñ×öµÄASP.NETÍøÕ¾ÅäÖõ½IIS£¬ÊµÏÖÔÚ¾ÖÓòÍøÖзÃÎÊ¡£ÔÚÍøÕ¾ÉÏÕÒÁËЩ×ÊÁÏ£¬×Ô¼ºÑо¿ÁËÏ£¬ÏÖ°ÑһЩ¾ßÌå²½Öè¼°ÎÊÌâ·ÖÏí³öÀ´£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
Ò»¡¢ÅäÖÃIIS
1¡¢"³ÌÐò"->"ÉèÖÃ"->"¿ØÖÆÃæ°å"->"¹ÜÀí¹¤¾ß"->Ñ¡Ôñ"Internet Ð ......
1.ASP.NETÖÐʹÓÃAJAXʱÈçºÎµ¯³ö¶Ô»°¿ò
¾ÙÀýÈçÏ£º
ScriptManager .RegisterStartupScript (UpdatePanel1, UpdatePanel1.GetType(), "", "alert('³É¹¦')", true)
ÏÂÃæÕâ¸ö¸´ÔÓЩ
ScriptManager .RegisterStartupScript (UpdatePanel1, UpdatePanel1.GetType(), "", "alert('Ìáʾ£º²úÆ·Ìí¼Ó³É¹¦£¡');if(confirm('ÊÇ·ñ¼ÌÐø ......
ÒÔÏÂÒýÓÃ×Ô MSDN Magazine:
²»Âۺûµ£¬UpdatePanel ¿Ø¼þ¶¼ÊÇ ASP.NET AJAX ÉçÇøËùϲ°®µÄ¡£ÎÒ˵“ºÃ”£¬ÊÇÒòΪ UpdatePanel ʹ²¿·ÖÒ³Ãæ³ÊÏÖ±äµÃÏ൱¼òµ¥£¬¶øËµ“»µ”£¬ÊÇÒòΪËüµÄ¼ò±ãºÍÒ×ÓÃÐÔÊÇÒÔЧÂʺÍÁîÈËÌäЦ½Ô·ÇµÄ´ø¿íΪ´ú¼ÛµÄ¡£
UpdatePanel ¿ÉÒÔΪһ°ãµÄÍøÒ³´øÀ´ AJAX ÉñÆæµÄºÃ´¦£¬µ«ÊÇËü²»ÄÜÌá ......
protected void btncancel_Click(object sender, EventArgs e)
{
Page.RegisterStartupScript("", "<mce:script type="text/javascript"><!--
window.close()
// --></mce:script>");
}
......
ΪÁËÍü¼Ç:
1,System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr, Int32);:void
//´ÓIISÀ´µÄÇëÇó
2,System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest) : Void
//ÔÚÕâÒ»²½´´½¨Ò»¸öHttpContext¶ÔÏó
3, System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext) : IHttpHandler
// ......