safest way to pass parameters between pages

A

Aussie Rules

Hi,

I have a few aspx (.net2) form.

The first form allows the user to enter into text box, and select values
from drop downs

The second form needs to use these values to process some data.

I am currently using the url to pass the values such as
'pagename.aspx?parm1=value&param2=value, and the second form does a
request.headers("parm1")

However this exposes the values in the browser, and I don't want this.

Is there a way to do this where its hidden from the user ?

Thanks
 
M

Mark Rae [MVP]

I have a few aspx (.net2) form.

The first form allows the user to enter into text box, and select values
from drop downs

The second form needs to use these values to process some data.

I am currently using the url to pass the values such as
'pagename.aspx?parm1=value&param2=value, and the second form does a
request.headers("parm1")

However this exposes the values in the browser, and I don't want this.

Is there a way to do this where its hidden from the user ?

Generally speaking, in ASP.NET there is no need to use two forms for this -
that is what a postback is for...

When the user clicks the <asp:Button>, the form will postback and the values
in the textboxes will be available for you to do your processing.
Afterwards, you can redirect to another page if you like, but there's no
need to...

http://www.google.co.uk/search?sour...=1T4GGIH_en-GBGB220GB220&q="ASP.NET"+postback
 
S

Steven Cheng[MSFT]

Hi Aussie,

Generally, for share data between web pages, you can use querystring,
session, database ........ However, for ASP.NET 2.0 page, it also provide
some particular features, such as the cross page postback(if you are using
submit/postback to redirect to other page). Or you can use Server.Transfer
to redirect page and use HttpContext.Items collection to store temp data.
Here is a msdn reference mentioend some of them:

#How to: Pass Values Between ASP.NET Web Pages
http://msdn2.microsoft.com/en-us/library/6c3yckfw(VS.80).aspx

BTW, do you think the suggestion that use single page with postback from
other members also possible for your case?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top