Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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.ItemType == ListItemType.AlternatingItem)
{
string OrderItemID =e.item.cells[1].Text;
...
e.item.Attributes.Add("ondblclick", "location.href='../ShippedGrid.aspx?id=" + OrderItemID + "'");
}
Ë«»÷±í¸ñ´ò¿ªÐÂÒ»Ò³
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
string OrderItemID =e.item.cells[1].Text;
...
e.item.Attributes.Add("ondblclick", "open('../ShippedGrid.aspx?id=" + OrderItemID + "')");
}
¡ïÌØ±ð×¢Ò⣺¡¾?id=¡


Ïà¹ØÎĵµ£º

ASP.NET Ò³ÃæÖ¸Áî Ö® @OutputCache

»º´æµÄÖØÒªÐԾͲ»ÓÃÔÙÇ¿µ÷ÁË£¬@OutputCache¸øÎÒÃÇÌṩÁËÒ»ÖÖÉùÃ÷µÄ·½Ê½(¶ÔÓ¦µÄ»¹Óбà³ÌµÄ·½Ê½)À´¿ØÖÆÒ³ÃæºÍÓû§¿Ø¼þµÄ»º´æ²ßÂÔ£¬ÕâÊÇÒ»ÖÖ×î¼òµ¥Ö±½ÓµÄÍøÕ¾ÓÅ»¯·½Ê½¡£
»¹ÊÇÏÈÀ´¹ýÒ»±é@OutpuCacheËùÓеÄÊôÐÔ£¬¹²ÓÃ11¸öÊôÐÔ£¬Õâ¸öÖ¸Áî¿ÉÒÔÓÃÓÚÒ³Ãæ(.aspx)ºÍÓû§¿Ø¼þ(.ascx)
ÊôÐÔ
Duration
Ò³»òÓû§¿Ø¼þ½øÐлº´æµÄʱ¼ä£¬µ¥Î ......

MySQL£¨asp.net£© ÊÂÎñ

 try
        {
            string _conStr = "Driver={MySQL ODBC 3.51
Driver};server=localhost;database=test;uid=test;password=1;option=3";
          & ......

asp.netÊý¾Ýµ¼³öµ½word

ÎÒ¾õµÃÕâ¸öÎÄÕ²»ÄÜËãÎÒµÄÔ­´´£¬ÒòΪ´úÂëÒ²ÊÇÎÒ´Ó±ðµÄµØ·½ÕÒµ½µÄ£¬¶øÇÒÎÒÔÚÍøÉϲéÁË£¬»ù±¾É϶¼ÊÇÕâÌ×´úÂë¡£
ͨÓõİÑÊý¾Ýµ¹½øword»òÕßexcel¡£ÕâÀïµÄµ¼ÈëexcelºÍÎÒ֮ǰµÄÄÇÆªÎÄÕÂÖеķ½·¨ÊDz»Ò»ÑùµÄ¡£
´úÂëÈçÏ£º
aspxÒ³ÃæÖУº
<form id="form1" runat="server">
       &nbs ......

asp.netÖÐʱ¼ä¸ñʽ»¯µÄ¼¸ÖÖ·½·¨

Çмǣ¬ÇÐ¼Ç DateTime.Now.Date.ToString("yyyyÄêMMÔÂddÈÕ"); //MM Òª´óд£¬·ñÔò»áÊÇ00,²»ÊÇÕæÊµµÄÔÂ·Ý private void getDate()
{
date.Text = DateTime.Now.Date.ToString("yyyyÄêMMÔÂddÈÕ"); //Õâ¸öËæÒâµÄ£ºyyyy-MM-dd Ò²¿ÉÒÔ
string Temp="";
switch (DateTime.Now.DayOfWeek)
{
case DayO ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ