You can pass the parameter value after ? sign. following is the code to create query string.
- protected void btnSend_Click(object sender, EventArgs e)
- {
- Response.Redirect("Default2.aspx?UserId="+txtUserId.Text+"&UserName="+txtUserName.Text);
- }
But You can get the value on second page using two way.
- protected void Page_Load(object sender, EventArgs e)
- {
- if(!IsPostBack)
- {
- lblUserId.Text = Request.QueryString["UserId"];
- lblUserName.Text = Request.QueryString["UserName"];
- }
- }
- Or
-
- protected void Page_Load(object sender, EventArgs e)
- {
- if(!IsPostBack)
- {
- lblUserId.Text = Request.QueryString[0];
- lblUserName.Text = Request.QueryString[1];
- }
- }