Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i have two web forms pages.

how do i append values to the querystring in the first page, and then extract them on the second page?

i know its easy to pass values in web form pages using properties, but i want to do it using the query string appended to the URL. i want to know how to pass values in from one html page to another and then display the 2nd page. thanks for any help

Posted

You just need to change the form method to 'GET' and the values would be appended to the URL.

 

But be careful as there is limitation on the length of the data can posted using GET method.

 

Then you can use Request.QueryString("ParameterName') to retrieve the value.

 

 

 

 

 

 

 

 

HTH.

Jitesh Sinha
Posted

That's all great and well for ASP 3.0 but in .NET we tend to use more modern techniques such as Dim s As String = Request.QueryString for getting values from the query string. Since controls in ASP.NET or view state driven you really don't need to have a 'POST' and 'GET' methods. If you are doing this you are using ASP.NET in the wrong way and should continue using ASP 3.0 or earlier.

 

If you have a spefic parameter (such as link that opens a certain window upon clicking) you would either

 

A) Set the action in the OnClick event if it's a link button, or the action necessary depending on the control type.

B) If it's data driven use a combination of the CommandArgument/Command Name

 

You can also you Context if you want to persist properties from one page to another or Session or Cookies. I wouldn't rely on Session too heavily and unless you're in a controlled environment I wouldn't use cookies since many people have them turned off.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...