asp.net ·þÎñÆ÷¶Ë¿Ø¼þÖÐ µ¯³ö¶Ô»°¿ò ²Ù×÷
HTML´úÂ룺
<script language="javascript" event="onclick" for="ImageButton1">
return confirm('È·¶¨Òª±£´æ±ä¸üÂð£¿');//·µ»Øfalseʱ²»Ö´ÐÐImageButton1_Click·½·¨£¬·µ»ØtureʱִÐÐImageButton1_Click·½·¨
</script>
<asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="AbsMiddle" ImageUrl="images/accept.gif" OnClick="ImageButton1_Click" />
C#´úÂ룺
/// <summary>
/// ±£´æ
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
string i = SaveData();
if (i == "1")
{
this.HidSaveTorF.Value = "1";
}
else
{
this.HidSaveTorF.Value = "-1";
}
}
Ïà¹ØÎĵµ£º
ASP.NET±à³ÌÄ£ÐÍÖ®ASP.NETÒ³ÃæÉúÃüÖÜÆÚͼ½â
ASP.NET±à³ÌÄ£ÐÍÖÐASP.NETÒ³ÃæÉúÃüÖÜÆÚÊÇָʲôÄØ£¿Ëü°üÀ¨Ê²Ã´ÄØ£¿ASP.NET±à³ÌÄ£ÐÍÖ®ASP.NETÒ³ÃæÉúÃüÖÜÆÚ¾ßÌåµÄ¹ý³ÌÓÐÄÄЩÄØ£¿ÏÂÃæ¾Í¿ªÊ¼ÎÒÃǵĽ²½â°É£º
ASP.NET Ò³ÔËÐÐʱ£¬´ËÒ³½«¾ÀúÒ»¸öÉúÃüÖÜÆÚ£¬ÔÚÉúÃüÖÜÆÚÖн«Ö´ÐÐһϵÁд¦Àí²½Öè¡£ÕâЩ²½Öè°üÀ¨³õʼ»¯¡¢ÊµÀý»¯¿Ø¼þ¡¢»¹ÔºÍ ......
·µ»Ø°´Å¥µÄʵÏÖ·½·¨£¨asp.net ÖУ©
Òý×Ô:http://blog.sina.com.cn/s/blog_49df2d0b0100aqoy.html
·µ»ØÉÏÒ»Ò³µÄÕâ¸ö¶«¶«ÔÚÎÒÃÇ×öÏîÄ¿µÄʱºòÒ»°ãÊÇÓÃÓÚÌîдÍê±íµ¥ºóÈ·ÈϵÄʱºò£¬ÓжÔÔÀ´ÊäÈëµÄÊý¾Ý½øÐÐÐÞ¸ÄʱÓõģ¬»òÕßÊÇÒòΪÍøվΪÁË·½±ãä¯ÀÀÕ߶øÓÐÐÄÌí¼Ó µÄÒ»¸ö¶«¶«£¬Ò»°ãÕâÖÖ¹¦ÄܵÄʵÏÖÔÚASP.netÖж¼ÊÇÓÃÒ»¸öbuttonµÄ¿ ......
MainPageÎļþ£ºWebForm1.aspx
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="TestMasterPage.WebForm1" enableViewState="False"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML> ......
Ê×ÏÈÃèÊöÒ»ÏÂÎÊÌâ:ÒòΪ¿Í»§µÄÐèÒª,°ÑËùÓжÔÓÚÊý¾Ý¿âµÄ²Ù×÷×ö³ÉÁË´æ´¢¹ý³Ì,ͬʱҲ´æÔÚ´øÓÐÊäÈë²ÎÊýµÄ´æ´¢¹ý³Ì.¿Í»§ÒªÇó½«ËùÓеÄÐÅÏ¢¶¼¿ÉÒÔÓÃË®¾§±¨±íÏÔʾ.ÎÒÃǶ¼ÖªµÀ,ҪʹÓÃË®¾§±¨±íÎÒÃǾÍҪʹÓÃÊý¾ÝÔ´µÄ.ÔÚÕâÀï,ÎÒÃÇʹÓõÄÊý¾ÝÔ´×ÔÈ»¶øȻҲ¾ÍÊÇ´æ´¢¹ý³ÌÁË.µ±È»,ÎÒÃÇÒ²ÊÇÖªµÀµÄ,ÔÚADO.NETµÄÁ ......
×÷Ϊ¸öÈËÍøÕ¾»òСÐÍÍøÕ¾µÄ±àдÕߣ¬Ê®°Ë°ãÎäÒÕ¶¼µÃͨÏþÒ»µã£¬±ÈÈç˵ javascript¡¢CSS/DIV¡¢HTML¡¢±à³ÌÓïÑÔ¡¢Êý¾Ý¿â֪ʶµÈ¡£µ±ÎÒÃDZàдһ¸öСÐÍÓ¦ÓóÌÐòʱ£¬ÈçºÎ×öµ½¸ßЧ¡¢Ë¼Â·ÇåÎúÄØ£¿ÒÔÏÂÊÇÎÒµÄÒ»µã¾Ñé×ܽᡣÓ×ÖÉÓë²»×ãÖ®´¦»¹ÍûµÃµ½Í¬ÐеÄÖ¸µã¡£
Ò»Ìõ×ܵÄ˼Ï룺ÔÚÓ¦ÓóÌÐò±àÒë·¢²¼ºó£¬aspxÎļþ¡¢dllÎļ ......