fguihen Posted November 3, 2005 Posted November 3, 2005 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 Quote
Jitesh Posted November 3, 2005 Posted November 3, 2005 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. Quote Jitesh Sinha
fguihen Posted November 3, 2005 Author Posted November 3, 2005 just one more thing. how do i send and use data in the next page using the POST method ? Quote
Jitesh Posted November 7, 2005 Posted November 7, 2005 Change the Form method to 'POST' and retrieve using Request.Form("ParameterName"). HTH Quote Jitesh Sinha
bri189a Posted November 7, 2005 Posted November 7, 2005 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.