Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÈÏʶASP.NETÅäÖÃÎļþWeb.config

Ò»¡¢ÈÏʶWeb.configÎļþ
Web.configÎļþÊÇÒ»¸öXMLÎı¾Îļþ£¬ËüÓÃÀ´´¢´æ ASP.NET Web Ó¦ÓóÌÐòµÄÅäÖÃÐÅÏ¢£¨Èç×î³£ÓõÄÉèÖÃASP.NET Web Ó¦ÓóÌÐòµÄÉí·ÝÑéÖ¤·½Ê½£©£¬Ëü¿ÉÒÔ³öÏÖÔÚÓ¦ÓóÌÐòµÄÿһ¸öĿ¼ÖС£µ±Äãͨ¹ýVB.NETн¨Ò»¸öWebÓ¦ÓóÌÐòºó£¬Ä¬ÈÏÇé¿öÏ»áÔÚ¸ùĿ¼×Ô¶¯´´½¨Ò»¸öĬÈϵÄ
Web.configÎļþ£¬°üÀ¨Ä¬ÈϵÄÅäÖÃÉèÖã¬ËùÓеÄ×ÓĿ¼¶¼¼Ì³ÐËüµÄÅäÖÃÉèÖá£Èç¹ûÄãÏëÐÞ¸Ä×ÓĿ¼µÄÅäÖÃÉèÖã¬Äã¿ÉÒÔÔÚ¸Ã×ÓĿ¼ÏÂн¨Ò»¸öWeb.configÎļþ¡£Ëü¿ÉÒÔÌṩ³ý´Ó¸¸Ä¿Â¼¼Ì³ÐµÄÅäÖÃÐÅÏ¢ÒÔÍâµÄÅäÖÃÐÅÏ¢£¬Ò²¿ÉÒÔÖØд»òÐ޸ĸ¸Ä¿Â¼Öж¨ÒåµÄÉèÖá£
ÔÚÔËÐÐʱ¶ÔWeb.configÎļþµÄÐ޸IJ»ÐèÒªÖØÆô·þÎñ¾Í¿ÉÒÔÉúЧ£¨×¢£º£¼processModel£¾ ½ÚÀýÍ⣩¡£µ±È»Web.configÎļþÊÇ¿ÉÒÔÀ©Õ¹µÄ¡£Äã¿ÉÒÔ×Ô¶¨ÒåÐÂÅäÖòÎÊý²¢±àдÅäÖýڴ¦Àí³ÌÐòÒÔ¶ÔËüÃǽøÐд¦Àí¡£
¶þ¡¢web.configÅäÖÃÎļþ£¨Ä¬ÈϵÄÅäÖÃÉèÖã©ÒÔÏÂËùÓеĴúÂ붼Ӧ¸ÃλÓÚ
£¼configuration£¾
£¼system.web£¾
¡¡¡¡ºÍ
£¼/system.web£¾
£¼/configuration£¾
Ö®¼ä£¬³öÓÚѧϰµÄÄ¿µÄÏÂÃæµÄʾÀý¶¼Ê¡ÂÔÁËÕâ¶ÎXML±ê¼Ç
1¡¢£¼authentication£¾ ½Ú
×÷ÓãºÅäÖà ASP.NET Éí·ÝÑéÖ¤Ö§³Ö£¨ÎªWindows¡¢Forms¡¢PassPort¡¢NoneËÄÖÖ£©¡£¸ÃÔªËØÖ»ÄÜÔÚ¼ÆËã»ú¡¢Õ¾µã»òÓ¦ÓóÌÐò¼¶±ðÉùÃ÷¡££¼authentication£¾ ÔªËرØÐèÓ룼authorization£¾ ½ÚÅäºÏʹÓá£
ʾÀý£º
ÒÔÏÂʾÀýΪ»ùÓÚ´°Ì壨Forms£©µÄÉí·ÝÑéÖ¤ÅäÖÃÕ¾µã£¬µ±Ã»ÓеǽµÄÓû§·ÃÎÊÐèÒªÉí·ÝÑéÖ¤µÄÍøÒ³£¬ÍøÒ³×Ô¶¯Ìøתµ½µÇ½ÍøÒ³¡£
£¼authentication mode="Forms" £¾
£¼forms loginUrl="logon.aspx" name=".FormsAuthCookie"/£¾
£¼/authentication£¾
ÆäÖÐÔªËØloginUrl±íʾµÇ½ÍøÒ³µÄÃû³Æ£¬name±íʾCookieÃû³Æ
2¡¢£¼authorization£¾ ½Ú
×÷Ó㺿ØÖÆ¶Ô URL ×ÊÔ´µÄ¿Í»§¶Ë·ÃÎÊ£¨ÈçÔÊÐíÄäÃûÓû§·ÃÎÊ£©¡£´ËÔªËØ¿ÉÒÔÔÚÈκμ¶±ð£¨¼ÆËã»ú¡¢Õ¾µã¡¢Ó¦ÓóÌÐò¡¢×ÓĿ¼»òÒ³£©ÉÏÉùÃ÷¡£±ØÐèÓ룼authentication£¾ ½ÚÅäºÏʹÓá£
ʾÀý£ºÒÔÏÂʾÀý½ûÖ¹ÄäÃûÓû§µÄ·ÃÎÊ
£¼authorization£¾
¡¡£¼deny users="?"/£¾
£¼/authorization£¾
×¢£ºÄã¿ÉÒÔʹÓÃuser.identity.nameÀ´»ñÈ¡ÒѾ­¹ýÑéÖ¤µÄµ±Ç°µÄÓû§Ãû£»¿ÉÒÔʹÓÃ
web.Security.FormsAuthentication.RedirectfromLoginPage·½·¨½«ÒÑÑéÖ¤µÄÓû§Öض¨Ïòµ½Óû§¸Õ²ÅÇëÇóµÄÒ³Ãæ.¾ßÌåµÄʵÀýÇë²Î¿¼:
FormsÑéÖ¤ http://www.fanvb.net/websample/dataauth.aspx
3¡¢£¼compilation£¾½Ú
×÷ÓãºÅäÖà ASP.NET ʹÓõÄËùÓбàÒëÉèÖá£Ä¬ÈϵÄdebugÊôÐÔΪ“True”.Ô


Ïà¹ØÎĵµ£º

asp.netÉú³É¾²Ì¬Ò³Ã棨¾²Ì¬Ò³ÃæÖаüÀ¨ÓÐʵʱÐÅÏ¢£©

    asp.netÉú³É¾²Ì¬Ò³Ãæͨ³£»áÓÐ2Öз½Ê½£¬Ò»ÖÖÊÇα¾²Ì¬£¬Ò»ÖÖÊÇÊÂÏÈдºÃÄ£°åÈ»ºóÖ±½ÓÌæ»»ÄÚÈÝ¡£¶ÔÓÚ2ÖÖ·½Ê½µÄÓÅȱµã£¬Ôڴ˲»ÌÖÂÛ£¬ÖصãÊÇ˵ϵڶþÖÖ·½Ê½£¬ÔÚÉú³É¾²Ì¬Ò³ÃæÖÐÓÐһЩÐÅÏ¢ÐèҪʵʱ´ÓÊý¾Ý¿â¶ÁÈ¡£¨±ÈÈ磺ÔÚÐÂÎÅÒ³Ã棬ÎÒÃÇ»áÐèҪһЩÈȵãÅÅÐУ¬ÕâЩÈȵãÐÂÎÅÎÒÃǾÍÐèҪʵʱµÄ´ÓÊý¾Ý¿âÀï±ßÄõ½£©¡£
......

asp.net ʵÏÖexcelµ¼Èëµ½Êý¾Ý¿â

//ExcelÅúÁ¿µ¼Èëµ½Êý¾Ý¿â
      protected void btnUpload_Click(object sender, EventArgs e)
      {   
         string IsXls = System.IO.Path.GetExtension(UploadExcel.FileName.ToString().ToLower ......

ÏòAsp.netÒ³ÃæÌí¼Ójavascript½Å±¾

1¡¢Ê¹ÓÃPage.ClientScript.RegisterClientScriptBlock
RegisterClientScriptBlock·½·¨¿ÉÒÔ°ÑJavaScriptº¯Êý·ÅÔÚÒ³ÃæµÄ¶¥²¿¡£Ò²¾ÍÊÇ˵£¬¸Ã½Å±¾ÓÃÓÚÔÚä¯ÀÀÆ÷ÖÐÆô¶¯Ò³Ãæ¡£
Code
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object send ......

ASP.NET¿çÒ³Ãæ´«Öµ¼¼ÇÉ

ASP.NET¿çÒ³Ãæ´«Öµ¼¼ÇÉ×Ü½á ¹ØÓÚÒ³Ãæ´«ÖµµÄ·½·¨£¬Òý·¢Á˺ܶàÌÖÂÛ¡£¿´À´ÓкܶàÈ˹Ø×¢Õâ¸ö£¬ÎÒ¾ÍÎÒ¸öÈ˹۵ã×öÁËЩ×ܽᣬϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1.  Ê¹ÓÃQueryString±äÁ¿
QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ