ASP.NETÒ³ÃæÖ®¼ä´«µÝÖµµÄ¼¸ÖÖ·½·¨
Ò».ʹÓÃQueryString
Request.QueryString
ÔÚASPʱ´ú£¬Õâ¸öÊǽϳ£Óõķ½·¨£¬µ½ÁËASP.NET£¬ºÃÏñÓõÄÈ˲»¶àÁË£¬µ«ÊDz»¹ÜÔõô˵£¬ÕâÊÇÒ»¸öûÓйýʱ£¬ÇÒºÜÖµµÃÍƼöµÄ·½·¨£¬ÒòΪ²»¹ÜÊÇASP»¹ÊÇASP.NET£¬×î»ù±¾µÄ¶¼»¹ÊÇ»ùÓÚHTTpÐÒéµÄ¡£ ȱµãÊǷdz£Ã÷ÏԵģ¬ÈÃÔÚ¶à¸öÒ³Ãæ´«µÝʱ£¬¿ÉÄܾÍRequest²»µ½ÁË
ʹÓÃQueryStringÔÚÒ³Ãæ¼ä´«µÝÖµÊÇÒ»Öַdz£³£¼ûµÄ·½·¨£¬ÎÒÃÇÔÚASPÖоͳ£³£Óõ½¡£
(1)ÓŵãºÍȱµã
Óŵ㣺
1.ʹÓüòµ¥£¬¶ÔÓÚ°²È«ÐÔÒªÇ󲻸ßʱ´«µÝÊý×Ö»òÊÇÎı¾Öµ·Ç³£ÓÐЧ¡£
ȱµã£º
1.ȱ·¦°²È«ÐÔ£¬ÓÉÓÚËüµÄÖµ±©Â¶ÔÚä¯ÀÀÆ÷µÄURLµØÖ·Öеġ£
2.²»ÄÜ´«µÝ¶ÔÏó¡£
(2)ʹÓ÷½·¨
1.ÔÚÔ´Ò³ÃæµÄ´úÂëÖÐÓÃÐèÒª´«µÝµÄÃû³ÆºÍÖµ¹¹ÔìURLµØÖ·¡£
2.ÔÚÔ´Ò³ÃæµÄ´úÂëÓÃResponse.Redirect(URL);Öض¨Ïòµ½ÉÏÃæµÄURLµØÖ·ÖС£
3.ÔÚÄ¿µÄÒ³ÃæµÄ´úÂëʹÓÃRequest.QueryString["name"];È¡³öURLµØÖ·Öд«µÝµÄÖµ¡£
(3)Ó¦ÓþÙÀý
1.Ô´Ò³Ãæ*.aspxµÄ´úÂ룺
private void Button1_Click(object sender, System.EventArgs e)
{
string urlAddress;
string Name1;
string Name2;
string Name3;
string Name1Value = "HelloName1";
int Name2Value = 1234567;
string Name3Value = "ÄãºÃÃû³Æ3";
urlAddress = "destinationWebForm.aspx?Name1=" + Name1Value + "&" + "Name2=" + Name2Value.ToString() + "&" + "Name3=" + Name3Value;
Response.Redirect(urlAddress);
}
2.Ä¿µÄÒ³ÃædestinationWebForm.aspxµÄ´úÂë:
private void Page_Load(object sender, System.EventArgs e)
{
string myName1Value;
int myName2Value;
string myName3Value;
myName1Value = Request.QueryString["Name1"];
myName2Value = Convert.ToInt32(Request.QueryString["Name2"]);
myName3Value = Request.QueryString["Name3"];
}
(4)¿ÉÄܳöÏÖµÄÎÊÌâ
1ÔÚ´¦ÀíResonse.QueryStringº¯Êýºº×Ö²ÎÊý´«µÝʱ£¬·¢Éú²»ÄÜÍêÕû´«µÝ²ÎÊýµÄ¾ßÌåÖµµÄ´íÎ󣬽â¾öÓÐÁ½¸ö·½·¨¡£
·½·¨Ò»£ºÐèÒªÖØÐÂÉèÖÃWeb.configÖеÄencodingºÍÈ«Çò»¯ÉèÖá£
1¡¢Ê×ÐУº<?xml version="1.0" encoding="utf-8" ?>
¸ü¸ÄΪ£º
Ïà¹ØÎĵµ£º
²âÊÔ»·¾³£ºwindows server 2003+visual studio 2008
''' <summary>
''' »ñÈ¡ExcelÎļþËùÓй¤×÷±íµÄÃû³Æ
''' </summary>
''' <param name="iSubPath">ExcelÎļþ·¾¶£¬È磺D:\test.xls</param>
  ......
1.ʲôÊǸöÐÔ»¯·þÎñ ¸öÐÔ»¯·þÎñÊÇÒ»ÖÖ¼¼Êõ¿ò¼Ü£¬ÎªÓû§ÌṩÁË×Ô¶¨ÒåÕ¾µãÍâ¹Û¡¢ÄÚÈÝ¡¢²¼¾Ö¡¢½ÇÉ«¹ÜÀíµÈ¹¦ÄÜ£¬ÈçͬQQ¿Õ¼äµÈ¡£ 2.¸öÐÔ»¯·þÎñÐèÒª³ÌÐòԱѧϰÄÄЩ·½Ã棬²ÅÄÜʵÏÖÕâЩ¹¦ÄÜ ¸öÐÔ»¯·þÎñÊÇÒ»¸ö¿ò¼Ü£¬Õâ¸ö¿ò¼Ü°üº¬3¸öºËÐŦÄÜ£º¸öÐÔ»¯Óû§ÅäÖá¢web²¿¼þ¡¢³ÉÔ±×ʸñÓë½ÇÉ«¹ÜÀí¡£ÎÒÃǾÍÊÇÒª×ÅÖØѧϰÕâ3¸ö¹¦ÄÜ¡ ......
ÓÉÓÚ¾³£ÒªÐ´Ò»Ð©²É¼¯µÄ³ÌÐò£¬ÏÂÃæµÄÈý¸öº¯ÊýÊDzɼ¯Öеĺܳ£Óõĺ¯Êý¡£¹ÃÇҽвɼ¯ÏµÍ³ÍòÄÜÕýÔò±í´ïʽ°É¡£
µÚÒ»¸ö£º//»ñÈ¡Ò³ÃæµÄhtmlÔ´Âë
public string GetHtmlSource(string Url, string charset)
{
& ......
Dotjum 這邊Òª½é紹Ò²ÊÇÒ»個ºÜ經µäµÄ ASP.NET ÀÏ問題£¬¾ÍÊÇÔõ麼ÒªÔÚÏÂÀ選項ÖУ¬Ò»開ʼ DataBind() 資ÁÏ繫結時£¬
¾ÍÏȳö現預設選項 請選擇£¬Æä實×ö這個· ......