How to pass a value from one asp page to another asp page using queryString?

How to transfer a value from one asp.net page to another asp.net page using queryString.It means test1.aspx and test2.aspx are two web pages.

In test1.aspx, I have a string value,

string abc="stackoverflow"; 

if i use it

Request.Redirect ("test2.aspx? Numbers =" + abc); .It does not work. If I use this, I cannot get the abc value on the page test2.aspx.

 how to get this abc values into the test2.aspx? 
+4
source share
1 answer

Instead

 Request.Redirect("test2.aspx?numbers=" + abc); 

Use

 Response.Redirect("test2.aspx?numbers=" + abc); 

To get the QueryString value on the test2.aspx page, you can use

 Request.QueryString["numbers"]; 
+7
source

Source: https://habr.com/ru/post/1442027/


All Articles