¶¨ÒåºÍʹÓÃASP.NET Profile(¸½Àý)
1¡¢Ë«»÷Ò»¸öÊý¾ÝÔ´¿Ø¼þ£¬½«Òª´æ´¢profileµÄÊý¾Ý¿â×÷ΪÊý¾ÝÔ´¼ÓÈë¿Ø¼þ£¨Õâ¸ö²½ÖèûʲôÓã¬Ö»ÊÇΪÁË·½±ã´ó¼ÒÓÿؼþ½¨Á¢Á¬½Ó£¬ÕâÑù²»ÈÝÒ׳ö´í£©£¬½¨Á¢ºÃÖ®ºó½«designÒ³ÃæµÄÊý¾ÝÔ´¿Ø¼þɾ³ý£¬Äã»á·¢ÏÖÔÚweb.configÀﻹÊÇÓÐÒ»ÌõÁ¬½ÓÓï¾ä£¬²»ÒªÉ¾³ý£¬ÎÒÃÇÏÂÃæ½«Óõ½Ëü£¬È磺 <connectionStrings>
<add name="aspnetdbConnectionString" connectionString="Data Source=JAMESSHENG;Initial Catalog=aspnetdb;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
2¡¢¶¨ÒåProfile,ÔÚÔ´ÂëÖмÓÈë
<profile enabled="true" automaticSaveEnabled="true" defaultProvider="SqlProvider">
<providers>
<clear/>
<add name="sqlProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="aspnetdbConnectionString" applicationName="ProfileSample" description="Sample for asp.net Profile and Profile Service"/>
</providers>
<properties>
<add name="BackGroudColor" type="System.String" allowAnonymous="true"/>
</properties>
</profile>
<anonymousIdentification enabled="true"/>
//defaultproviderÖ¸¶¨Ä¬ÈÏÅäÖÃÎļþÌṩ³ÌÐòµÄÃû³Æ
automaticSaveEnabledÖ¸¶¨Óû§ÅäÖÃÎļþÊÇ·ñÔÚ ASP.NET Ò³Ö´ÐнáÊøÊ±×Ô¶¯±£´æ¡£Èç¹ûΪtrue£¬ÔòÓû§ÅäÖÃÎļþÔÚ ASP.NET Ò³Ö´ÐнáÊøÊ±×Ô¶¯±£´æ¡£
providers(¿ÉÑ¡ÔªËØ)¶¨ÒåÅäÖÃÎļþÌṩ³ÌÐòµÄ¼¯ºÏ,Ëüµ±Öаüº¬<add> :name = defaultProviderµÄÖµ;type = System.Web.Profile.SqlProfileProviderÊÇʹÓÃsql;connectionStringName = aspnetdbConnectionStringʹÓÃÉÏÃæÁ¬½ÓÖж¨ÒåµÄÁ¬½Ó×Ö·û´®;
properties(±ØÑ¡µÄÔªËØ)¶¨ÒåÓû§ÅäÖÃÎļþÊôÐÔºÍÊôÐÔ×éµÄ¼¯ºÏ,Ëüµ±Öаüº¬<add>:name=“BackGroudColor”¶¨ÒåProfileÖеÄÊôÐÔÃû³Æ;type="System.String"×Ö·û´®ÀàÐÍ;allowAnonymous="true"¶¨ÒåÊÇ·ñ±£´æÄäÃûÓû§ÅäÖÃ,Èç¹ûÔÚ´Ë´¦¶¨Òåtrue£¬ÔòÔÚºóÃæ±ØÐë¼ÓÈë<anonymousIdentification>ÅäÖÃ,Éè
Ïà¹ØÎĵµ£º
Ò»¡¢SqlDataReadºÍDatasetµÄÑ¡Ôñ
SqldatareadÓŵ㣺¶ÁÈ¡Êý¾Ý·Ç³£¿ì¡£Èç¹û¶Ô·µ»ØµÄÊý¾Ý²»Ðè×ö´óÁ¿´¦ÀíµÄÇé¿öÏ£¬½¨ÒéʹÓÃSqlDataReader£¬ÆäÐÔÄÜÒª±ÈdatsetºÃºÜ¶à¡£È±µã£ºÖ±µ½Êý¾Ý¶ÁÍê²Å¿ÉcloseµôÓÚÊý¾Ý¿âµÄÁ¬½Ó
(SqlDataReader ¶ÁÊý¾ÝÊÇ¿ìËÙÏòǰµÄ¡£SqlDataReader ÀàÌṩÁËÒ»ÖÖ¶ÁÈ¡´Ó SQL Server
Êý¾Ý¿â¼ìË÷µÄÖ»½øÊý¾ÝÁ÷µ ......
¸Õ¸Õ ¿´µ½Õâôһ¸öÎÊÌ⣬ÕâÀïÒ²×ö¸ö±ê¼Ç£ºhttp://topic.csdn.net/u/20080411/14/7b0f9da5-0413-4149-91e9-72c3df3018a3.html?seed=327251592
µÚÒ»ÖÖ·½Ê½£º
//ÔÚVisual Studio 2008Öе÷ÊÔͨ¹ý
testPop_Page.aspx:Ö÷Ò³ÃæASPX´úÂë
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  ......
ÎÒÏëÔÚaspÖмÓÒ»¸öÁ´½Ó£¬Ö¸Ïòasp.netÍøÒ³£¬µ«asp.netµÄÍøÖ·ÊǾ¹ýHttpUtility.UrlEncode±äÐκÍHttpUtility.UrlDecode±ä»ØµÄ£¬¶øaspµÄserver.urlencodeÈ´²úÉú²»Á˺ÍHttpUtility.UrlEncodeÒ»ÑùµÄ±àÂ룬ÇëÎÊÓÐûÓнâ¾ö°ì·¨
²¹³ä£ºÔÀ´asp.netµÄÊÇ"web.aspx?str="+HttpUtility.UrlEncode(str)
ºÍHttpUtility.UrlDecode(Requ ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......
н¨Ò»¸öĬÈϵÄASP.NET MVC2Ó¦ÓóÌÐò£¬ÏµÍ³»áĬÈϵÄÉú³É°üº¬»ù±¾¹¦ÄܵÄÓ¦ÓóÌÐò£¬²é¿´ÕâЩÉú³ÉµÄ´úÂ룬¿É°ïÖúÎÒÃÇÀí½âASP.NET MVC2¡£ÏÂÃæÊǶÔURL·ÓɵÄÀí½â£¬ÒÔ±¸Íü¡£
Ò»¡¢Global.asax.csÖеĴúÂ룺
public class MvcApplication : System.Web.HttpApplication
{
&n ......