我正在尝试使用 C# 通过带参数的 HTTP GET 接收从其他非 aspx 页面传递到我的 asp.net 页面的值。如果我在 Page Load 事件中使用 Request.QueryString 获取值会好吗?
请指教。
这是我到目前为止所做的。
protected void Page_Load(object sender, EventArgs e)
{
//fetch query from url
string queryTimeStamp = Request.QueryString["t"];
Int64 queryCallerID = Convert.ToInt64(Request.QueryString["s"]);
int querySMSGateway = Convert.ToInt32(Request.QueryString["d"]);
string querySMSMessage = Request.QueryString["m"];
//Do other processings
}
最佳答案
可以在Request.QueryString
或Request.Form
集合中获取值
关于c# - 如何使用 HTTP GET 接收传递给 ASP.NET 页面的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8472673/