Tried searching on ways to transfer more than 1 value, did manage to find a way but when running it, it only transfers one of the values and duplicates it in the second text box although I did put two different values in the textbox. Currently using Microsoft Visual Studio, which are aspx.cs files.
This is the code that is from WebForm1.aspx.cs
protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("WebForm2.aspx?val=" + TextBox1.Text); Response.Redirect("WebForm2.aspx?val=" + TextBox2.Text); } This is the code that is supposedly suppose to receive the values from WebForm1
protected void Page_Load(object sender, EventArgs e) { Label1.Text = Request.QueryString["val"]; Label2.Text = Request.QueryString["val"]; } After running it, it leads to the design page, entered different values for both textboxes. After clicking the button, it leads to WebForm2.aspx, it shows the value that I had input for TextBox1 in both Label1 and Label2. The value which was in TextBox2 is no where to be found. I'm fairly new to C# coding so I have no idea on where I went wrong.
Response.Redirectin ASP.NET WebForms raises a ThreadAbortException after having generated its output, so the secondResponse.Redirect(or any other code you may have there) is never executed.