Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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('..


Ïà¹ØÎĵµ£º

ASP.NET´ÓSQL ServerÊý¾Ý¿âÌáȡͼƬ²¢ÏÔʾÔÚDataGrid

ʹÓÃGridview°ó¶¨Êý¾Ý¿âÖеÄͼƬ(תÔØ)
×¢£º´ËϵÁмǼÔÚÎÒʵ¼Ê¿ª·¢ÖÐÓöµ½µÄÎÊÌâºÍÊÕ²ØһЩ¼¼ÇÉÎÄÕ¡£
ÎÒÃǶ¼ÖªµÀ£¬ÔÚGridviewÖв»ÄÜÖ±½ÓÈ¥°ó¶¨Êý¾Ý¿âÖеÄͼƬ£¬ÎÒÃÇ¿ÉÒÔÀûÓÃHttpHandlerºÜÈÝÒ×µÄÍê³ÉÕâ¸öÈÎÎñ£¬ÔÚÕâÀïÎҼǼһÏÂÕâ¸ö¹ý³Ì¡£
1.ÉÏ´«Í¼Æ¬´æ´¢µ½Êý¾Ý¿âÖÐ
ÔÚÊý¾Ý¿âÖд´½¨Ò»¸ö±í£¬Ìí¼ÓÒ»ÏÂ3¸ö×ֶΣº
²½ÖèÒ»£ ......

ÈçºÎÔÚASP.NetºÍJavaScriptÖд«µÝÊý¾Ý

×î½üÅöµ½Ò»ÎÊÌ⣬ÐèÒªÔÚASP.NetºÍJavaScriptÖд«µÝÊý¾Ý¡£¾ßÌåµÄÐèÇóÊÇÕâÑùµÄ£¬Ò³Ãæpostbackºó½«»áload JS£¬µ«ÊÇÐèÒª¼Çס֮ǰij¸ö״̬£¬Õâ¸ö״̬ÊÇÖ¸JSµÄ״̬£¬Ò²¾ÍÊÇ˵load JSºó£¬»¹Òª¼Çס֮ǰµÄ״̬£¬¶ø²»Êǻص½Ä¬ÈϵÄ״̬¡£
Ò»¿ªÊ¼ÏëÁ˺ܶà°ì·¨£¬µ«¶¼²»³É¹¦£¬ºóÀ´ÎÊÁËÎÊͬÊ£¬·¢ÏÖ¿ÉÒÔͨ¹ýÒþ²ØµÄ±íµ¥ÔªËØÀ´´«µÝÊý¾Ý£¬ËùÒ ......

ASP.net c# ÈÕÆÚת»¯[ת]

ÈÕÆÚת»¯Ò»
ΪÁË´ïµ½²»Í¬µÄÏÔʾЧ¹ûÓÐʱ£¬ÎÒÃÇÐèÒª¶Ôʱ¼ä½øÐÐת»¯£¬Ä¬ÈϸñʽΪ£º2007-01-03 14:33:34 £¬Òª×ª»¯ÎªÆäËû¸ñʽ£¬ÒªÓõ½DateTime.ToStringµÄ·½·¨(String, IFormatProvider)£¬ÈçÏÂËùʾ£º
using System;
using System.Globalization;
String format="D";
DateTime date=DataTime,Now;
Response.Write(date.ToS ......

ASP.NET MVC½éÉÜ

The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ