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¿ÉÒÔÀûÓÃWebConfigurationManagerºÍÖ±½ÓÀûÓÃXML·½Ê½²Ù×÷web.config,WebConfigurationManager±È½Ï¼òµ¥£¬µ«ÊÇÇå³ý×¢ÊÍ´úÂë¡£Á½Õß²Ù×÷·½Ê½¶¼ÐèÒªÓÐдȨÏÞ¡£
·½·¨Ò»£¬ÀûÓÃWebConfigurationManager£¬ÐèÒªÒýÓÃSystem.Web.Configuration.WebConfigurationM ......
·µ»Ø°´Å¥µÄʵÏÖ·½·¨£¨asp.net ÖУ©
Òý×Ô:http://blog.sina.com.cn/s/blog_49df2d0b0100aqoy.html
·µ»ØÉÏÒ»Ò³µÄÕâ¸ö¶«¶«ÔÚÎÒÃÇ×öÏîÄ¿µÄʱºòÒ»°ãÊÇÓÃÓÚÌîдÍê±íµ¥ºóÈ·ÈϵÄʱºò£¬ÓжÔÔÀ´ÊäÈëµÄÊý¾Ý½øÐÐÐÞ¸ÄʱÓõģ¬»òÕßÊÇÒòΪÍøվΪÁË·½±ãä¯ÀÀÕ߶øÓÐÐÄÌí¼Ó µÄÒ»¸ö¶«¶«£¬Ò»°ãÕâÖÖ¹¦ÄܵÄʵÏÖÔÚASP.netÖж¼ÊÇÓÃÒ»¸öbuttonµÄ¿ ......
asp.net ¶Ô Îļþ½øÐÐѹËõ or ½âѹ£¨zip£©
/// <summary>
/// ¶ÔÎļþ½øÐУ¨Ñ¹Ëõ£¬½âѹ£©
/// </summary>
public static class ZIP
{
/// <summary>ѹËõÎļþ</summary>
/// <param name="filename">filenameÉú³ÉµÄÎļþµÄÃû³Æ£¬È磺C\123\123.zip</param>
/// <param name="d ......
Ê×ÏÈÃèÊöÒ»ÏÂÎÊÌâ:ÒòΪ¿Í»§µÄÐèÒª,°ÑËùÓжÔÓÚÊý¾Ý¿âµÄ²Ù×÷×ö³ÉÁË´æ´¢¹ý³Ì,ͬʱҲ´æÔÚ´øÓÐÊäÈë²ÎÊýµÄ´æ´¢¹ý³Ì.¿Í»§ÒªÇó½«ËùÓеÄÐÅÏ¢¶¼¿ÉÒÔÓÃË®¾§±¨±íÏÔʾ.ÎÒÃǶ¼ÖªµÀ,ҪʹÓÃË®¾§±¨±íÎÒÃǾÍҪʹÓÃÊý¾ÝÔ´µÄ.ÔÚÕâÀï,ÎÒÃÇʹÓõÄÊý¾ÝÔ´×ÔÈ»¶øȻҲ¾ÍÊÇ´æ´¢¹ý³ÌÁË.µ±È»,ÎÒÃÇÒ²ÊÇÖªµÀµÄ,ÔÚADO.NETµÄÁ ......
1. ×¢²ájsº¯Êý
String scriptString = "<script language=JavaScript>function doClick(){";
scriptString += "for(var index=0;index<myArray.length;index++)";
scriptString += "alert(myArray[index]);}<";
scriptString += "/" + "script>";
ClientScript.RegisterStartupScript(typeof(WebForm2) ......