ASP.NET¿çÒ³Ãæ´«Öµ¼¼ÇÉ
1. ʹÓÃQueryString±äÁ¿
¡¡¡¡QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µÝÊý×é»ò¶ÔÏóµÄ»°£¬¾Í²»ÄÜÓÃÕâ¸ö·½·¨ÁË¡£ÏÂÃæÊÇÒ»¸öÀý×Ó£º
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
string s_url;
s_url = "b.aspx?name=" + Label1.Text;
Response.Redirect(s_url);
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
Label2.Text = Request.QueryString["name"];
}
2. ʹÓÃApplication ¶ÔÏó±äÁ¿ //²»¹ýApplicationÊÇÓÃÀ´´æÈ¡È«¾ÖÐÔµÄÖµµÄ
//µ¥¸öÓû§Èç¹ûÐèÒªÔÚÒ³Ãæ¼û´«µÝ²ÎÊýµÄ»°»¹ÊÇÆäËûµÄ¼¸ÖÖ·½Ê½±È½ÏºÏÊʵã
¡¡¡¡Application¶ÔÏóµÄ×÷Ó÷¶Î§ÊÇÕû¸öÈ«¾Ö£¬Ò²¾ÍÊÇ˵¶ÔËùÓÐÓû§¶¼ÓÐЧ¡£Æä³£Óõķ½·¨ÓÃLockºÍUnLock¡£
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
Application["name"] = Label1.Text;
Server.Transfer("b.aspx");
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
string name;
Application.Lock();
name = Application["name"].ToString();
Application.UnLock();
}
3. ʹÓÃSession±äÁ¿
¡¡¡¡Ïë±ØÕâ¸ö¿Ï¶¨ÊÇ´ó¼ÒʹÓÃÖÐ×î³£¼ûµÄÓ÷¨ÁË£¬Æä²Ù×÷ÓëApplicationÀàËÆ£¬×÷ÓÃÓÚÓû§¸öÈË£¬ËùÒÔ£¬¹ýÁ¿µÄ´æ´¢»áµ¼Ö·þÎñÆ÷ÄÚ´æ×ÊÔ´µÄºÄ¾¡¡£
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
Session["name"] = Label.Text;
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
string name;
name = Session["name"].ToString();
}
4. ʹÓÃCookie¶ÔÏó±äÁ¿
¡¡¡¡Õâ¸öÒ²ÊÇ´ó¼Ò³£Ê¹Óõķ½·¨£¬ÓëSessionÒ»Ñù£¬ÆäÊÇʲ¶Ôÿһ¸öÓû§¶øÑԵģ¬µ«ÊÇÓиö±¾ÖʵÄÇø±ð£¬¼´CookieÊÇ´æ·ÅÔÚ¿Í»
Ïà¹ØÎĵµ£º
·ÃÎÊ IIS ÔªÊý¾Ý¿âʧ°Ü¡£
˵Ã÷: Ö´Ðе±Ç° Web ÇëÇóÆڼ䣬³öÏÖδ´¦ÀíµÄÒì³£¡£Çë¼ì²é¶ÑÕ»¸ú×ÙÐÅÏ¢£¬ÒÔÁ˽âÓйظôíÎóÒÔ¼°´úÂëÖе¼Ö´íÎóµÄ³ö´¦µÄÏêϸÐÅÏ¢¡£
Òì³£ÏêϸÐÅÏ¢: System.Web.Hosting.HostingEnvironmentException: ·ÃÎÊ IIS ÔªÊý¾Ý¿âʧ°Ü¡£
ÓÃÓÚÔËÐÐ ASP.NET µÄ½ø³ÌÕÊ»§±ØÐë¾ßÓÐ¶Ô IIS ÔªÊý¾Ý¿â(Èç IIS://se ......
1¡¢ÔÚcompilation Ï£¬ÇëÉèÖÃdebug=false £¬ÈçÏ£º
default Language="c#" debug="false">
2¡¢ÇëʹÓÃServer.Transfer´úÌæResponse.Redirect¡£
3¡¢Ê¹ÓÃValidator¿Ø¼þ£¬ÇëÒª¾³£¼ì²éPage.IsValid¡£
4¡¢ÇëʹÓÃforeachÑ»·£¬¶ø²»ÊÇΪ×Ö·û´®µü´úÑ»·¡£
5¡¢ÇëʹÓÿͻ§¶ËÑéÖ¤·½Ê½(²»ÒªÃ¿´Î¶¼ÔÚ·þÎñ¶ËÑéÖ¤)¡£
6¡ ......
2.4 µ¼º½ÌõÉè¼Æ·½°¸
Ò»¸öWebÕ¾µã£¬ÓÈÆäÊÇÐÅÏ¢Á¿´óµÄ´óÖÐÐÍWebÕ¾µã£¬Ó¦ÎªÓû§Ìṩվµãµ¼º½¡£Õ¾µãµ¼º½ÊÇÿ¸öÍøÕ¾±Ø²»¿ÉÉٵģ¬ËüÏ൱ÓÚ³ÇÊй«Â·µÄ·±ê¡£Í¨¹ýµ¼º½ÌõÉè¼Æ·½°¸£¬¿ÉÒÔʹÍøÕ¾ä¯ÀÀÕßÕÒµ½×Ô¼ºÏëÒªµÄÄÚÈÝ¡£
2.4.1 Ê÷Ð͵¼º½ÌõÉè¼Æ·½°¸
Ê÷Ð͵¼º½ÌõÉè¼ÆÖ÷ÒªÓ¦ÓÃTreeView¿Ø¼þ£¬TreeView¿Ø¼þ¶ÔÊý¾ÝÓÐ×ÅÁ¼ºÃµÄÖ§³Ö£¬Í¨¹ýÏÔ ......
´°Ìå´úÂë:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AgentObjects;
using SpeechLib;
using System.Web;
using System.Threading;
using System.Text.RegularExpressio ......