[ASP.NET](note)Request的用法

摘要:[ASP.NET]Request的用法

1.string name = Request.QueryString["name"];  //接受URL等查詢字符串的集合。 //get  
2.string tbName = Request.Form["TextBox1"];  //是用來接受窗體表單等變量。 //post
3.string tempName = Request["name"];
4. <asp:text   id="pName"   .../>   
  string   sId=Request.Params["id"]   
  string   sName=Request.Params["pName"]  //獲取Request.QueryString和Request.Form等項的集合。   
--
Request.Params         是所有post和get傳過来的值的集合,
Request.Form            是取post傳值, 
Request.QueryString 是get傳過来的值
--
get  :用Request.QueryString承接
post :用Request.Form承接
 

Request.Params的用法範例
html:
<a href='request.aspx?id=123456'  >request test</a>
 
.CS:
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Request.QueryString["id"];
}

POST提交:把提交的資料放置在是HTTP包的包體中。上文示例中紅色字體標明的就是實際的傳輸資料,
因此,GET提交的資料會在位址欄中顯示出來,而POST提交網址欄不會有 ?id=XXXX
 
 
--
強烈建議購物網店或實體店家都必須使用關鍵字廣告or原生廣告來將Yahoo上與聯播網的廣大流量導至自己的網站!

●Yahoo關鍵字廣告/原生廣告
◆Yahoo廣告方案介紹 : https://goo.gl/5k8FHW
◆Yahoo廣告剖析與運用 : http://goo.gl/4xjUJD

 

​​