473,326 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Server.Redirect to post to another page question

I'm trying to post from Page1 to Page2.
Page1:
controlData.Value = "Data value";//controlData is HtmlInputHidden
// Request.Form["controlData"] would return: "Data"
Server.Redirect("Page2.aspx",true);

Page2:
string sData = Request.Form["controlData"] ;//would return: "Data"

Problem: sData gives me: "Data" where I want to get "Data value";
How else can I send the string to Page2 if I have the string just before
Redirect(ing) ?

Thanks,
Oleg
Nov 19 '05 #1
2 2781
Sorry, read 'Server.Transfer' where it says: 'Server.Redirect'

"Oleg" wrote:
I'm trying to post from Page1 to Page2.
Page1:
controlData.Value = "Data value";//controlData is HtmlInputHidden
// Request.Form["controlData"] would return: "Data"
Server.Transfer("Page2.aspx",true);

Page2:
string sData = Request.Form["controlData"] ;//would return: "Data"

Problem: sData gives me: "Data" where I want to get "Data value";
How else can I send the string to Page2 if I have the string just before
Transfer(ing) ?

Thanks,
Oleg

Nov 19 '05 #2

please see explanation below ...

Oleg wrote:
Sorry, read 'Server.Transfer' where it says: 'Server.Redirect'

"Oleg" wrote:
I'm trying to post from Page1 to Page2.
Page1:
controlData.Value = "Data value";//controlData is HtmlInputHidden
you have declared some html to be output ...
// Request.Form["controlData"] would return: "Data"
it would once this page was received by a browser
and a user clicked submit and then you received a request

but at this point it is just html on the way to the response buffer
Server.Transfer("Page2.aspx",true);
and now you have transferred the current request
to a new page, you are missing a whole roundtrip

Page2:
string sData = Request.Form["controlData"] ;//would return: "Data"

Problem: sData gives me: "Data" where I want to get "Data value";
How else can I send the string to Page2 if I have the string just before
Transfer(ing) ?
i can think of a number of ways but ...
i think you need to read up on basic http
and then ask yourself if there isn't a cleaner
way to achieve whatever it is you are trying to achieve

what are you trying to achieve? what does the second page do?

Thanks,
Oleg


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Alex Hunsley | last post by:
A question that has certainly been asked before and I've googled etc. for answers with no certain outcome... I'd like my PHP script to redirect the client browser to another page, POSTing some...
6
by: StephenMcC | last post by:
Hi All, Got a quick query in relation to the Server.Transfer method available in IIS 5+/ASP. I've got an issue where I want to take a portion of an online app and extract this out into a web...
5
by: Jon Sequeira | last post by:
Is there a way to redirect from an ASP.NET page to an ASP page without showing the ASP page's URL in the client's browser? This works perfectly with an HTML page, for example: path =...
2
by: Pete | last post by:
Hi all... I sincerly hope one of the MS guys can clear this up for me... First some background... Ok, I have a web site which is fully translatable into several languages. All the strings...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
6
by: someone | last post by:
I am in a situation where I need to package some information from Page1, submit it via POST to another server which will process the information and then send the user to another page on my server...
1
by: David | last post by:
I need to redirect to a page and HTTP Post data. The Response.Redirect does not work and the HTTPREQUEST option calls the page and waits for a response, but I need to transfer control to the...
1
by: Mike Hofer | last post by:
I really need some help, and I'd appreciate any that you folks can provide. The ASP.NET application in question uses version 1.1 of the .NET Framework. All of the pages use a common base class...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.