JavaScriptÅжÏÎÊÌâ¡£¡£¡£ - .NET¼¼Êõ / ASP.NET
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string strMsg = "ÄãÈ·¶¨ÒªÉ¾³ýÂð£¿";
int flag = 0;
Response.Write("<Script Language='JavaScript'>if ( window.confirm('" + strMsg + "')) { "+(flag = 1)+"} else {" +(flag = 0) +"};</script>");
if (flag == 0)
{
e.Cancel = true;
}
}
ÎÒÏëÔÚgridviewÖеãɾ³ýʱ¡£µ¯³ö¶Ô»°¿òÅжÏÊÇ·ñɾ³ý£¿È»ºó¿´ÊÇ·ñÖ´ÐвÙ×÷¡£¡£ÎªÊ²Ã´¾ÍÊDz»ÐÐÄØ
C# code:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[5].Attributes.Add("onclick", "return confirm('ÄãÈ·¶¨ÒªÉ¾³ýÂð£¿')");
}
}
//Cells[5]Õâ¸ö¶ÔÓ¦ÄãµÄɾ³ý¿Ø¼þËùÔÚµÄÀ¸Î»Ë³Ðò
ÄãµÄɾ³ýÊÇʹÓõÄcommandfield»¹ÊÇtemplatefield£¬×îºÃÄÜÌù³ö´úÂë¡£
ΪʲôҪResponse.Write£¿
ΪʲôҪe.Cancel=true£¿
Ë¿ºÁ¿´²»³öµÀÀí¡£
ÄãÕâ¾äÖеÄjsûÓзµ»Ø¿Í»§¶Ë£¬ÈçºÎÖ´ÐУ¿
=============
1Â¥Õý½â
ÏȲ»ËµÎªjavascript²»Ö´ÐÐ.
Ä㾹Ȼ°Ñ¿Í»§¶ËjavascriptµÃµ½µÄflag = 0/1 Ö±½Ó¸³Öµ¸øÁ˺ǫ́µÄC#´úÂëÖеÄflag±äÁ¿?
Ïà¹ØÎÊ´ð£º
±¾È˹¤×÷¾ÑéÒ»ÄêÒÔÉÏ
ÊìϤasp.net
ÊìϤjavascript
ÊìϤCss
ÊìϤajax
ÊìϤsqlserver2005
ÓÐÒ»ÄêµÄÏîÄ¿¾Ñé
¾ßÌåÏîÄ¿ºÍÆäËûµÄ¾Í²»ÔÚÕâдÁË
ÓÐÒâÕßÁªÏµ£º
QQ:359233910
ÒýÓÃ
±¾È˹¤×÷¾ÑéÒ»ÄêÒÔÉÏ
ÊìϤasp ......
±¾ÈËÊDzËÄñÒ»¸ö£¬Æ½Ê±Òª×öÉúÒ⣬µ«ÊÇÕÒÁ˺ܶàÈË×öÍøÕ¾£¬¾ù±»ÆÁË¡£×öµÃ²»Èý²»ËÄ£¬ÏÖÔÚ¾öÐÄ×Ô¼ºÀ´×öÒ»¸ö£¬ÒÑѧϰASP.NETÏà¹ØµÄÍøÒ³ÖÆ×÷֪ʶ£¬ÓÐDW»ù´¡£¬¿ÉÒÔ˵ÊÇÄ¿Ç°Ö»ÓÐÀíÂÛ֪ʶ£¬µ«ÊÇÔÚʵ¼Ê¾ßÌå²Ù×÷µÄʱºò£¬×ÜÊÇÓöµ ......
¸÷λ´óÏÀ£¬ÎÒѧϰµÄÊÇASP.NET£¬ÏëÖªµÀÏà¹Ø¼¼ÊõÓÐÄÄЩ£¬¾ÍÏñJAVA EEÖÐÓÐstruct sping jsp severlet µÈ£¬ASP.NET»¹ÓÐÄÄЩЩÏà¹Ø¼¼Êõ¡£
http://topic.csdn.net/u/20090914/21/af27de99-f0f3-4cfd-9379-13764f8ec6b1.ht ......
ÎÒÓÐÁ½¸ödropdownlist¶¼°óºÃÁËÖµ£¬ÏëÑ¡ÖÐÒ»¸ödropdownlistÖеÄÖµ£¬È»ºóÔÚÁíÒ»¸ödropdownlistÖÐÑ¡ÖÐÏàÓ¦µÄÒ»Ïî¡£
²»ÊÇ´Óа󶨵ڶþ¸ödropdownlist£¬ÊÇÔÚÒѾ°óºÃµÄÖµµ±ÖÐÑ¡ÖÐÒ»¸ö¡£
ÎÒÏëÓÃjsд
ÇóÖú
Äã¿ÉÒÔ°Ñdrop ......
O O O O O O
|.......| |........| |.......|
| | |
O O ......