It seems you just want:
string username = Request.QueryString["username"];
Noldorin
2009-03-14 17:53:13
It seems you just want:
string username = Request.QueryString["username"];
You can add a hidden field in your aspx file:
<asp:HiddenField ID="username" runat="server" />
And in your code behind populate it from the request parameter:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
username.Value = Request["username"];
}
}
This returns value from form elements :
string username = Request.Form["username"];
This returns value from querystring :
string username = Request.QueryString["username"];
This looks both form and querystring collections :
string username = Request["username"];