ASP.NETÖÐÈçºÎʵÏÖFORMÈÏÖ¤µÇ¼
ÈçºÎÔËÓà Form ±íµ¥ÈÏÖ¤
ASP.NET µÄ°²È«ÈÏÖ¤£¬¹²ÓГWindows”“Form”“Passport”“None”ËÄÖÖÑé֤ģʽ¡£“Windows”Óë“None”ûÓÐÆðµ½±£»¤µÄ×÷Ó㬲»ÍƼöʹÓ㻓Passport”ÎÒÓÖûÓùý£¬°¦……ËùÒÔÎÒÖ»ºÃ½²½²“Form”ÈÏÖ¤ÁË¡£ÎÒ´òËã·ÖÈý²¿·Ö£º
µÚÒ»²¿·Ö —— ÔõÑùʵÏÖfrom ÈÏÖ¤£»
µÚ¶þ²¿·Ö —— Form ÈÏÖ¤µÄʵսÔËÓã»
µÚÈý²¿·Ö —— ʵÏÖµ¥µãµÇ¼£¨Single Sign On£©
µÚÒ»²¿·Ö ÈçºÎÔËÓà Form ±íµ¥ÈÏÖ¤
Ò»¡¢ н¨Ò»¸ö²âÊÔÏîÄ¿
ΪÁ˸üºÃ˵Ã÷£¬ÓбØҪн¨Ò»¸ö²âÊÔÏîÄ¿£¨ÔÝÇÒΪ“FormTest”°É£©£¬°üº¬ÈýÕÅÒ³Ãæ×ãÒÓ£¨Default.aspx¡¢Login.aspx¡¢UserInfo.aspx£©¡£É¶£¿ÓÐÈ˲»»áн¨ÏîÄ¿£¬²»»áÐÂÔöÒ³Ã棿ÄãÎÊÎÒÕ¦°ì£¿ÎÒ¿´Õâô°ìºÃÁË£ºÍϳöÈ¥£¬´ò»ØԽ壬´ÓÓ׶ù԰ѧÆð……
¶þ¡¢ ÐÞ¸Ä Web.config
1¡¢ Ë«»÷ÏîÄ¿ÖеÄWeb.config£¨²»»áµÄ¡¢ÕÒ²»µ½µÄ´ò PP£©
2¡¢ ÕÒµ½ÏÂÁÐÎÄ×Ö <authentication mode="Windows" /> °ÑËü¸Ä³É£º
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name=".ASPXAUTH"></forms>
</authentication>
3¡¢ ÕÒµ½<authorization> <allow users="*" /></authorization>»»³É
<authorization><deny users="?"></deny></authorization>
ÕâÀïûʲôºÃ˵µÄ£¬Ö»Òª¿½±´¹ýÈ¥¾ÍÐС£Ëä˵Èç´Ë£¬µ«»¹ÊÇÓÐÈË»áŪ´í£¬ÈçÏ£º
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name=".APSX"></forms>
<deny users="?"></deny>
</authentication>
ÈôÒªÎÊÊÇË°Ñ <deny users="?"></deny> ·ÅÈë <authentication> Öеģ¬ÎÒ»áºÜÈÙÐҵظæËßÄ㣬ÄÇÊÇ N ÄêÇ°µÄÎÒ£º<authentication> Óë <authorization> ¶¼ÊÇÒÔ auth ×Öĸ¿ªÍ·ÓÖ¶¼ÊÇÒÔ ation ½á⣬ºÎÆäÏàËÆ£»Ó¢Îĵ¥´Ê±³²»ÏÂÀ´µÄÎÒÒÔΪËûÃÇÊÇÒ»»ïµÄ……
Èý¡¢ ±àд .cs ´úÂë——µÇ¼ÓëÍ˳ö
1¡¢ µÇ¼´úÂ룺
a¡¢ Êé±¾ÉϽéÉܵÄ
private void Btn_Login_Click(object sender, System.EventArgs e)
 
Ïà¹ØÎĵµ£º
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) ......
ASP.NET»ñÈ¡ÌìÆøÔ¤±¨´óÖ·ÖÎöÓÐ 1µ½Ä³¸öÍøÕ¾ÉÏ·ÖÎöÍøÕ¾µÄ´úÂë»ñÈ¡£»2×Ô¼ºÐ´Çý¶¯·þÎñºÍweb·þÎñ µÚ¶þÖÖˮ̫Éî²»ÔøÉæ¼°¡£
ASP.NETºǫ́³ÌÐò»ñÈ¡ÖÐÑëÆøÏǫ́ÌìÆøÔ¤±¨
1.ÌìÆø·â×°³ÉÒ»¸öʵÌå
2.¿ÉÒÔ»ñÈ¡µ±ÌìÌìÆø£¬Ò²¿ÉÒÔ»ñȡδÀ´ÎåÌìµÄÌìÆø¼¯ºÏ
using System;
using System.Collections.Generic;
using System.Text;
......
Request¶ÔÏó¹¦ÄÜÊÇ´Ó¿Í»§¶ËµÃµ½Êý¾Ý£¬³£ÓõÄÈýÖÖÈ¡µÃÊý¾ÝµÄ·½·¨ÊÇ£ºRequest.Form¡¢Request.QueryString£¬Request¡£ÆäµÚÈýÖÖÊÇÇ°Á½ÖÖµÄÒ»¸öËõд£¬¿ÉÒÔÈ¡´úÇ°Á½ÖÖÇé¿ö¡£¶øÇ°Á½ÖÖÖ÷Òª¶ÔÓ¦µÄFormÌύʱµÄÁ½ÖÖ²»Í¬µÄÌá½»·½·¨£º·Ö±ðÊÇPost·½·¨ºÍGet·½·¨¡£
Request ¶ÔÏóµÄÊôÐԺͷ½·¨± ......
ÓÃASP.NETÓëSQL SERVER¿ÉÊÇÔµ·Ý×îºÃÁË£¬ÉÔ´óµÄ³ÌÐòÒ»°ãµÚÒ»ÏÈ¿¼ÂǵÄÊÇSQL SERVER£¬Ö»ÊÇһЩºÜ¿¼ÂǾ¼ÃµÄ²ÅʹÓÃACCESSµÈÁË¡£ÓÃSQL SERVER£¬ÎªÁËʹÊý¾Ý¿âµÄЧÂʸüºÃ£¬Ò»°ã¶¼»á²ÅÈ¡´æ´¢¹ý³Ì£¬Òò´æ´¢¹ý³ÌÖ´ÐÐËٶȿ죬²¢ÇÒ¿ÉÒÔʵÏÖһЩ¸ß¼¶µÄ²éѯµÈ¹¦ÄÜ¡£±ÈÈç´«ÈëһЩÊý¾Ý²ÎÊý£¬µ«Ö´ÐеÄSQL¹ý³Ì¿ÉÄܲ»Í¬µÈ¡£
¡¡¡¡ÏÂÃæ¾ÍÀ´¸öÀý× ......
Asp.netµÄÉí·ÝÑéÖ¤ÓÐÓÐÈýÖÖ£¬·Ö±ðÊÇ"Windows | Forms | Passport"£¬ÆäÖÐÓÖÒÔFormsÑéÖ¤ÓõÄ×î¶à£¬Ò²×îÁé»î¡£
Forms ÑéÖ¤·½Ê½¶Ô»ùÓÚÓû§µÄÑéÖ¤ÊÚȨÌṩÁ˺ܺõÄÖ§³Ö£¬¿ÉÒÔͨ¹ýÒ»¸öµÇ¼ҳÃæÑéÖ¤Óû§µÄÉí·Ý£¬½«´ËÓû§µÄÉí·Ý·¢»Øµ½¿Í»§¶ËµÄCookie£¬Ö®ºó´ËÓû§ÔÙ·ÃÎÊÕâ¸öwebÓ¦ÓþͻáÁ¬Í¬Õâ¸öÉí·ÝCookieÒ»Æð·¢Ë͵½·þÎñ¶Ë¡£·þÎñ¶ËÉ ......