Posting information

R

Raja Balaji R

hi

I have a page1.aspx which accepts Username, Password which
is posted to page2.aspx using a submit button, i want
page2.aspx to submit, transfer or redirect the same posted
information which was received from page1.aspx to
page3.aspx and page3.aspx does the processing.

how to transfer, redirect with same posted information.

Thanks & Regards
Raja Balaji R
 
M

Munsifali Rashid

Use Server.Transfer. This will carry across the posted values. However, it
seems like page2.aspx is redundant, if you're posting values from page1.aspx
to page2.aspx, only to then send the same posted data to page3.aspx.

It sounds like there's probably a better solution to what you're trying to
achieve.

Regards,

Mun
 
N

netnews.comcast.net

This seems to be one major difference between ASP and ASP.Net. In ASP I
would do this kind of stuff all the time in an effort to try to keep code on
pages smaller and less complicated. For instance I might have user.asp and
usersave.asp where user.asp posted to usersave.asp. But, in .Net this
doesn't work very well because of all the postback stuff that .Net does for
you. It is best to change your logic to only use one page. A requirement
of asp.net is that a page can ONLY post back to itself. Otherwise the
hidden field(s) created by asp.net don't match between the pages, and .Net
doesn't know how to interpret the results.

Mark :)
 
S

Steve C. Orr [MVP, MCSD]

Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=600

http://www.dotnetbips.com/displayarticle.aspx?id=79
 

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

Top