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", "location.href=’../ShippedGrid.aspx?id=" + OrderItemID + "&rsq
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
Èç¹ûÄãÒѾÓн϶àµÄÃæÏò¶ÔÏ󿪷¢¾Ñ飬Ìø¹ýÒÔÏÂÕâÁ½²½£º
µÚÒ»²½¡¡ÕÆÎÕÒ»ÃÅ¡£NETÃæÏò¶ÔÏóÓïÑÔ£¬C#»òVB.NET ÎÒÇ¿ÁÒ·´¶ÔÔÚûϵͳѧ¹ýÒ»ÃÅÃæÏò¶ÔÏó£¨OO£©ÓïÑÔµÄÇ°ÌáÏÂȥѧASP.NET¡£ ASP.NETÊÇÒ»¸öÈ«ÃæÏò¶ÔÏóµÄ¼¼Êõ£¬²»¶®OO£¬ÄǾø¶Ôѧ²»ÏÂÈ¥£¡
µÚ¶þ²½¡¡¶Ô¡£NET FrameworkÀà¿âÓÐÒ»¶¨µÄÁ˽⠿ÉÒÔͨ¹ý¿ª·¢Windows FormÓ¦ÓóÌÐòÀ´Ñ ......
OnClientClick="this.disabled=true;this.form.submit();" UseSubmitBehavior="False"ÔÚ°´Å¥ÊôÐÔÖмÓÈëÕâ¶Î´úÂë
this.btnSubmit.Attributes["onclick"] = this.GetPostBackEventReference(this.btnSubmit) + ";this.disabled=true;";
Èç¹ûÊÇÌá½»ÊÇÒ»¸öButton£¬¿ÉÒÔʹÓÃjavascript£¬ÉèÖÃΪen ......
Iframe±ê¼Ç£¬Óֽи¡¶¯Ö¡±ê¼Ç£¬Äã¿ÉÒÔÓÃËü½«Ò»¸öHTMLÎĵµÇ¶ÈëÔÚÒ»¸öHTMLÖÐÏÔʾ¡£Ëü²»Í¬ÓÚFrame±ê¼Ç×î´óµÄÌØÕ÷¼´Õâ¸ö±ê¼ÇËùÒýÓõÄHTMLÎļþ²»ÊÇÓëÁíÍâµÄHTMLÎļþÏ໥¶ÀÁ¢ÏÔʾ£¬¶øÊÇ¿ÉÒÔÖ±½ÓǶÈëÔÚÒ»¸öHTMLÎļþÖУ¬ÓëÕâ¸öHTMLÎļþÄÚÈÝÏ໥Èںϣ¬³ÉΪһ¸öÕûÌ壬ÁíÍ⣬»¹¿ÉÒÔ¶à´ÎÔÚÒ»¸öÒ³ÃæÄÚÏÔʾͬһÄÚÈÝ£¬¶ø²»±ØÖظ´Ð´ÄÚÈ ......
ÀûÓÃApplication¶ÔÏóºÍSession¶ÔÏó¿ÉÒÔͳ¼Æµ±Ç°ÔÚÏßÓû§ÊýÁ¿.
×¢Òâ:
(1)ÔڻỰ¿ªÊ¼ºÍ½áÊøʱ,Ò»¶¨Òª½øÐмÓËøºÍ½âËø²Ù×÷¡£ÓÉÓÚ¶à¸öÓû§¿ÉÒÔ¹²ÏíApplication¶ÔÏó£¬Òò´Ë¼ÓËøÊDZØÒªµÄ£¬ÕâÑù¿ÉÒÔ±£Ö¤ÔÚͬһʱ
¿ÌÖ»ÓÐÒ»¸ö¿Í»§¿ÉÒÔÐ޸ĺʹæÈ¡Application¶ÔÏóµÄÊôÐÔ¡£Èç¹û¼ÓËøºó£¬³Ù³Ù²»¸ø¿ªËø£¬»áµ¼ÖÂÓû§ÎÞ·¨·ÃÎÊApplic ......