ASP.NET 2.0ÖÐʹÓÃMembership
תÔØ
£ºLoveCherry
¼¼ÊõÎÞ¼«ÏÞ
ͻ񻣼
±¾ÎĽéÉÜÁËÔõôÔÚ
ASP.NET 2.0
ÖÐʹÓÃ
Membership
ÐÂÌØÐÔ£¬²¢ÇÒ½éÉÜÁËÔõôÁ½ÖÖ²»Í¬µÄ
Membership
µÄ
Provider
£º
ActiveDirectoryMembershipProvider
ºÍ
SqlMembershipProvider
£¬Ç°ÕßÊÇ»ùÓÚ΢Èí»î¶¯Ä¿Â¼·þÎñ´æ´¢Óû§ÐÅÏ¢µÄ£¬»òÕßÊÇ»ùÓÚ
SQL SERVER
´æ´¢µÄ¡£
2.0
ÖеÄÕâ¸öлúÖÆ´ó´ó¼õÉÙÁËÕ¾µãÓû§ÈÏ֤ģ¿éµÄ´úÂëÁ¿¡£
Ŀ¼£º
ѧϰĿµÄ
ʹÓÃ
ActiveDirectoryMembershipProvider
ʹÓÃ
SqlMembershipProvider
ActiveDirectoryMembershipProvider
µÄһЩÉèÖòÎÊý
SqlMembershipProvider
µÄһЩÉèÖòÎÊý
Membership
µÄһЩ
API
ѧϰĿµÄ£º
ѧ»áʹÓÃ
Membership
½øÐÐ±íµ¥ÈÏÖ¤
ѧ»áÉèÖÃ
ActiveDirectoryMembershipProvider
ѧ»áʹÓÃ
ActiveDirectoryMembershipProvider
½¨Á¢ÈÏÖ¤Óû§
ѧ»áÉèÖÃ
SqlMembershipProvider
ѧ»á½¨Á¢
SQL SERVER Membership
Êý¾Ý¿â
ѧ»áʹÓÃ
SqlMembershipProvider
½¨Á¢ÈÏÖ¤Óû§
ʹÓÃ
ActiveDirectoryMembershipProvider
Èç¹ûÓû§ÐÅÏ¢ÊÇ´æ´¢ÔڻĿ¼ÖУ¬¶øÄãµÄÄÚÍø³ÌÐòÓÖÒòΪ·À»ðǽ»òÕßÐèÒªÊÊÓ¦²»Í¬µÄä¯ÀÀÆ÷µÈÔÒò²»ÄÜʹÓÃ
windows
¼¯³ÉÈÏÖ¤µÄ»°£¬Õâ¸öʱºòÄã¿ÉÒÔÑ¡ÔñʹÓÃ
ActiveDirectoryMembershipProvider
ʵÏÖ±íµ¥ÈÏÖ¤
»ù±¾µÄ²½ÖèÈçÏÂ
°´ÕÕÒÔϲ½ÖèÀ´ÓÃ
ActiveDirectoryMembershipProvider
ʵÏÖ
asp.net
³ÌÐòµÄÓû§±íµ¥ÈÏÖ¤
1
¡¢ÅäÖÃ±íµ¥ÈÏÖ¤
2
¡¢ÅäÖÃ
ActiveDirectoryMembershipProvider
3
¡¢½¨Á¢Óû§
4
¡¢ÈÏÖ¤Óû§
1
¡¢ÅäÖÃ±íµ¥ÈÏÖ¤
ҪʵÏÖ±íµ¥ÈÏÖ¤ÐèÒªÉèÖÃ
<authentication
>
µÄ
mode
ÊôÐÔΪ
"Forms"
£¬È»ºó°´ÕÕÏÂÃæµÄÀý×ÓÅäÖÃ
web.config
Îļþ
<authentication mode="Forms">
<forms loginUrl="Login.aspx"
protection="All"
timeout="30"
name="AppNameCookie"
path="/FormsAuth"
requireSSL="false"
&nbs
Ïà¹ØÎĵµ£º
1.updatepanel Öе¯³öÌáʾ´°¿Ú
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.Page.GetType(), "message", "alert('°¢ÐÜ£¡');", true);
2.ÔÚд°¿ÚÖдò¿ªÁ´½Ó
Response.Write(" <script>window.open('NewPage.aspx') </script>");
²»¹ýÿµ±µ¯³öÕâ¸öÍøÒ³¹ýºó,ÔÀ´µÄÖ÷ÍøÒ³µÄÒ³Ãæ×ÖÌå×Ô¶¯ ......
2010-01-0822:00:30
0¡¢ÒýÑÔ
Web Ò³ÃæÊÇÎÞ״̬µÄ£¬ ·þÎñÆ÷¶Ôÿһ´ÎÇëÇó¶¼ÈÏΪÀ´×Ô²»Í¬Óû§£¬Òò´Ë£¬±äÁ¿µÄ״̬ÔÚÁ¬Ðø¶ÔͬһҳÃæµÄ¶à´ÎÇëÇóÖ®¼ä»òÔÚÒ³ÃæÌøתʱ²»»á±»±£Áô¡£ÔÚÓÃAsp.NET Éè¼Æ¿ª·¢Ò»¸öWebϵͳʱ£¬ Óöµ½Ò»¸öÖØÒªµÄÎÊÌâÊÇÈçºÎ±£Ö¤Êý¾ÝÔÚÒ³Ãæ¼ä½øÐÐÕýÈ·¡¢°²È«ºÍ¸ßЧµØ´«ËÍ£¬Asp.net ÌṩÁË×´Ì ......
Ò»¡¢Response¶ÔÏó
Response¶ÔÏóÊÇHttpResponseÀàµÄÒ»¸öʵÀý¡£¸ÃÀàÖ÷ÒªÊÇ·â×°À´×ÔASP.NET²Ù×÷µÄHTTPÏìÓ¦ÐÅÏ¢¡£
1.Response¶ÔÏóµÄÊôÐÔ
¢Ù BufferOutput
˵Ã÷£º»ñÈ¡»òÉèÖÃÒ»¸öÖµ£¬¸ÃֵָʾÊÇ·ñ»º³åÊä³ö£¬²¢ÔÚÍê³É´¦ÀíÕû¸öÒ³Ö®ºó½«Æä·¢ËÍ
ÊôÐÔÖµ£ºÈç¹û»º³åÁ˵½¿Í»§¶ËµÄÊä³ö£¬ ......
//µÃµ½Êý¾ÝΪ¿âÁ¬½Ó
SqlConnection con=new SqlConnection("Êý¾Ý¿âÁ¬½Ó×Ö·û´®");
//Óô洢¹ý³ÌÃû³ÆºÍÊý¾Ý¿âÁ¬½Ó´´½¨SqlCommand ¶ÔÏó
SqlCommand command = new SqlCommand("´æ´¢¹ý³ÌÃû³Æ",con);
//´ò¿ªÁ¬½Ó
con.Open();
//¶ÔÊý¾Ý¿â½øÐÐÏàÓ¦µÄ²Ù×÷
...................................
........................... ......
ÔÚ½¨Á¢Óë·þÎñÆ÷µÄÁ¬½Óʱ³ö´í¡£ÔÚÁ¬½Óµ½ SQL Server 2005 ʱ£¬ÔÚĬÈϵÄÉèÖÃÏ SQL Server ²»ÔÊÐí½øÐÐÔ¶³ÌÁ¬½Ó¿ÉÄܻᵼÖ´Ëʧ°Ü¡£ (provider: SQL ÍøÂç½Ó¿Ú, error: 26 - ¶¨Î»Ö¸¶¨µÄ·þÎñÆ÷/ʵÀýʱ³ö´í)
1.Ê×ÏÈÔËÐÐSQLServer
2.È»ºóÔËÐÐC:\WINDOWS\Microsoft.NET\Framework\v2.0.5072 ......