Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 13th, 2004, 06:29 AM
Authorized User
 
Join Date: Jun 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gadhiav Send a message via Yahoo to gadhiav
Default Query Regarding passing Of Values

hi Frnds,
Thanks for answering so many queries till now and helping me to learn ASP.NET in the right and correct way.
So let me get back to business, frnds i have a small problem in which i require ur help.
The problem sounds somethin like this, here it goes-:
As usual creating a Web form , using Vb.NET as my language

The idea is to create reports, I have a page Where i Select some values From the Drop down lists as well as enter some values in the textboxes. Now when i press the Generate report button , a new page should appear containing the Datagrid which displays all the values. These values will be dependent on the selection criteria made in the previous page , i.e the contents of the data grid will be dependent on the values selected from the drop down lists and the values entered in the textboxes.
Now the problem is, how do i carry forward the entered and selected values from the first page to the second page. I need to do this Cos my data grid is on the second page and I need to have the query statement on the second page. I know we can use the REQUEST.FORM() to do it, but i m unable to do, so i m putting the question forward to all u people.

Hope you people have undeerstood my problem and what i am facing. If you have any doubts regarding the problem then pl feel free to pose questions.

Hope for a speedy reply from all
Thanks, Cheers,
Vishal

Life is not the Triumph but the Struggle
__________________
Life is not the Triumph but the Struggle
 
Old July 13th, 2004, 01:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

In ASP.NET, you have to reference it differently. This may help you out some: http://www.dotnetjohn.com/articles.aspx?articleid=142. Basically you do a Server.Transfer, which passes the values to the second page. But it passes it through the Context.Current.Handler object, which you have to ctype to the web page type. The article explains that option.

The other option is to create a class which stores these variables. Then you can store that object in the session, application, or cache mechanisms, which will retain the object for use in page 2.

I hope this is clear, if not, let me know.

Brian
 
Old July 14th, 2004, 12:25 AM
Authorized User
 
Join Date: Jun 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gadhiav Send a message via Yahoo to gadhiav
Default

Hi bmains,
thanks for the help. But using a class and then accessing it thru session, application or cache mechanisms will lead to heaviness on the web plage as well as the memory resources of the server, cos the session variables will hold on the buffer resources of the system.
It is fine if the varible that we use Many a times and is not directly refrence from one page to another to be stored as sessions variable.
Anyways if you, have any other idea of can find soem links realted to the topic then do get back to me.

Thanks,
Vishal

Life is not the Triumph but the Struggle
 
Old July 15th, 2004, 03:29 AM
Authorized User
 
Join Date: Feb 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mahulda
Default

Vishal,

Try Response.redirect()
e.g if NewFile is the name of yout second file then in your fisrt file write the following code

Response.redirect("NewFile.aspx?ddvalue=" & dd1.selcteditem.text & "&tbvalue=" & tb1.text)
where dd1 and tb1 are the dropdownlists and the textboxes respectively.

to acces these values in the second file , use
request("ddvalue")
request("tbvalue")

 
Old July 15th, 2004, 12:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

If you have two pages, page1 and page2, when you redirect from page1 to page2 using Server.Transfer(), then you can do in page2:

private sub Page_Load(..)
    Dim objPage as page1 = ctype(HttpContext.Current.Handler, Page1)
    txtTextbox2.Text = objPage.txtValue.Text
    .. go through all of the form properties ..
end sub

Please note that the form fields must be public access.

Brian
 
Old July 16th, 2004, 05:49 AM
Authorized User
 
Join Date: Jun 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gadhiav Send a message via Yahoo to gadhiav
Default

hi Frnds,
Thanks for reply to my query. I have used many of the tips fromn this topic and now i am able to pass the values to the next page.
Thanks once again for sharing ur ideas.
Hope to keep the communication process continues.
Bye , Cheers,
Vishal

Life is not the Triumph but the Struggle





Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing multiple values to a pass- through query donnie200 Access VBA 2 July 7th, 2005 04:00 PM
Passing values to query Lynque Classic ASP Databases 2 December 11th, 2004 05:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.