Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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.Item


Ïà¹ØÎĵµ£º

asp.net¿Í»§¶Ë»ò·þÎñ¶ËÑéÖ¤·½Ê½


¿Í»§¶ËÑéÖ¤·½Ê½£º
 protected void Page_Load(object sender, EventArgs e)
    {
       
        if (!IsPostBack)
        {
       &nbs ......

ASP.NET 2.0ÍøÕ¾ÓÅ»¯¼¼ÇÉ×ܽá

1. µ±²»ÐèҪʹÓÃSessionµÄʱºòÇë¹Ø±Õ
        ¹Ø±ÕSessionµ±²»ÐèҪʹÓõÄʱºò
• ÈôÒª½ûÓÃÒ³µÄ»á»°×´Ì¬£¬Ç뽫@ Page Ö¸ÁîÖеÄEnableSessionState ÊôÐÔÉèÖÃΪfalse¡£ÀýÈ磬 <%@ Page EnableSessionState="false" %>¡£
• ×¢ÒâÈç¹ûÒ³ÐèÒª·ÃÎʻỰ±äÁ¿£¬µ«²»´òËã´´½¨»òÐÞ¸ÄËüÃÇ£¬Ôò½« ......

ASP.NETÖ´Ðд洢¹ý³Ì£¬²¢»ñÈ¡´æ´¢¹ý³ÌµÄ·µ»ØÖµ

//Á¬½ÓÊý¾Ý¿â
        string myStr = CODE.DbHelperSQL.connectionString;
        SqlConnection myConn = new SqlConnection(myStr);
        myConn.Open();
      &nbs ......

ASP.NETÒ³Ãæˢз½·¨×ܽá

ÏÈ¿´¿´ASP.NETÒ³ÃæˢеÄʵÏÖ·½·¨£º
µÚÒ»£º
private void Button1_Click( object sender, System.EventArgs e )     {        Response.Redirect( Request.Url.ToString( ) );   }  
µ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ