ÈçºÎʹÓÃASP.NET Profile
Asp.NetÖÐÓÐÒ»Ì×ÓëÓû§Ïà¹ØÁªµÄÊôÐÔÉèÖ㬿ÉÒÔͨ¹ýÔÚWebConfigÀïÅäÖÃÀ´Ö±½ÓʹÓã¬ËûµÄ×÷ÓÃΪ
´æ´¢ºÍʹÓÃΨһÓëÓû§¶ÔÓ¦µÄÐÅÏ¢
Õ¹ÏÖ¸öÈË»¯°æ±¾µÄWebÓ¦ÓóÌÐò
Óû§µÄΨһÉí·Ý±êʶÔÚÔٴηÃÎÊʱʶ±ðÓû§
Asp.Net ProfileÌṩµÄ¸úÓû§Ïà¹ØµÄÀàÐͶ¼ÊÇÇ¿ÀàÐÍ
Ê×ÏÈÉú³ÉÊý¾Ý¿â½Å±¾£¬Ê¹ÓÃVisual Studio 2005 ÃüÁîÌáʾ£¬ÊäÈëÃüÁîÐÐaspnet_regsql -A p -sqlexportonly filename
-A£º±íÃ÷Ôö¼ÓÒ»¸öÊý¾Ý¿â
p£º±íÃ÷Éú³ÉµÄÊÇProfileµÄÊý¾Ý¿â
-sqlexportonly£º±íÃ÷Êǵ¹³ösql½Å±¾£¬ÓÃÆäËû²ÎÊý¿ÉÒÔÖ±½Ó´´½¨Êý¾Ý¿â£¬¾ßÌåµÄ˵Ã÷¿ÉÒԲο´aspnet_regsqlµÄ°ïÖú˵Ã÷
filename£º±£´æµÄÎļþÃû
ÏÖÔÚÊý¾Ý¿â´´½¨ºÃÁË£¬ÀïÃæÓÐ4Õűíaspnet_ApplicationÓÃÀ´´æ´¢Ó¦ÓóÌÐòµÄÏà¹ØÀàÐÍ£¬aspnet_ProfileÓÃÀ´±£´æÓû§µÄÊôÐÔÐÅÏ¢£¬aspnet_SchemaVersionÓÃÀ´´æ´¢°æ±¾ÐÅÏ¢£¬aspnet_UserÓÃÀ´±£´æÓû§ÐÅÏ¢¡£¿ÉÒÔ´ÓÕ⼸Õűí¿ÉÒÔ¿´µ½£¬¶à¸öÓ¦ÓóÌÐò¿ÉÒÔÓÃͬһ¸öÊý¾Ý¿âÀ´±íʾÓû§ÐÅÏ¢¡£
ÏÂÃæÊÇÈçºÎÀ´ÅäÖÃWebConfigÀ´Ö§³ÖProfile
Ê×ÏÈÅäÖÃÁ¬½Ó×Ö·û´®
<connectionStrings>
<add name="ProfileDatabase" connectionString="Server=192.168.1.2; Initial Catalog=aspnetdb; User ID=sa; Password=sa"/>
</connectionStrings>
È»ºóÔÚsystem.web½ÚµãÏÂÌí¼Óprofile½Úµã
<profile enabled="true" automaticSaveEnabled="true" defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ProfileDatabase"
applicationName="ProfileSample"
description="Sample for ASP.NET profile and Profile Service" />
</providers>
<properties>
<add name="Name" type="System.String"/>
<add name="Email" type="System.String" />
<add name="Age" type="System.Int32" />
<group name="Address">
<add name="City" type="System.String" />
<add name="Street" type="System.String" />
<add name="PostalCode" type="System.String" />
</group>
</properties>
</profile>
Ïêϸ˵Ã÷һϡ£automaticSaveEnalbed="true"£¬±íÃ÷Óû§ÔÚÌá½»Êý¾ÝÖ®ºó£¬×Ô¶¯±£´æÓû§ÊôÐÔ¡£properties½ÚµãÏÂÃæ¾ÍÊÇÓû§ÐèÒªÅäÖõÄ×Ô¼ºµÄÓû§ÊôÐÔ£¬group±íÃ÷ÕâÊÇÒ»¸ö×飬Ïàµ
Ïà¹ØÎĵµ£º
ASP.NET 2.0
Îļþ£±: Deafault.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&l ......
CTRL + SHIFT + BÉú³É½â¾ö·½°¸
CTRL + F7 Éú³É±àÒë
CTRL + O ´ò¿ªÎļþ
CTRL + SHIFT + O´ò¿ªÏîÄ¿
CTRL + SHIFT + CÏÔʾÀàÊÓͼ´°¿Ú
F4 ÏÔʾÊôÐÔ´°¿Ú
SHIFT + F4ÏÔʾÏîÄ¿ÊôÐÔ´°¿Ú
CTRL + SHIFT + EÏÔʾ×ÊÔ´ÊÓͼ
F12 תµ½¶¨Òå
CTRL + F12תµ½ÉùÃ÷
CTRL + ALT + J¶ÔÏóä¯ÀÀ
CTRL + ALT + F1°ïÖúĿ¼
CTR ......
ÔÚWeb¿ª·¢³ÌÐòÖУ¬ÍùÍùÓÉÓÚÖÖÖÖÔÒò£¬¿Í»§»á¶à´Î²Ù×÷Ò³Ãæµ¼ÖÂÊý¾ÝÈßÓà»ò²»Ò»Ö£¬ ÔÚASP.NET AJAX³öÏÖ֮ǰ¿ÉÒÔͨ¹ý¶Ô__dopostback()µÄµ÷Óõȷ½·¨Ò²¿ÉÒÔ·ÀÖ¹Ò³Ãæ¶à´ÎÌá½»¡£
ÔÚASP.NET AJAXÖеÄÒ³Ãæ¿Í»§¶ËÖÐÓÐÒ»¸ö½ÐonInitializeRequestµÄʼþ£¬ËüÔÚÒ³Ãæ³õʼ»¯Ö®Ç°´¥·¢£¬¿ÉÒÔ¶ÔÒ³ÃæµÄÌύʼþ½øÐпØÖÆ£¬²¢ÇÒ¿ÉÒÔµ÷ÓøÃʼþ²Î ......
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["BackUrl"] = Request.UrlReferrer.ToString();
}
}
/// <summary>
/// ·µ»Ø°´Å¥µã»÷ʼþ
/// </summary& ......
¸Õ¸Õ ¿´µ½Õâôһ¸öÎÊÌ⣬ÕâÀïÒ²×ö¸ö±ê¼Ç£º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">
  ......