473,378 Members | 1,142 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,378 software developers and data experts.

Convert GET to POST and Server.Transfer

CCY
Hi,

Is there a way to convert GET/QueryString to POST/Form when transfer
pages using Server.Transfer()?

For example,

1. page 1 url: http://domain/page1.aspx?name1=value1
2. page 2 url: http://domain/page2.aspx

I have no access to page2.aspx and it is coded to only handle POST
request. I also can't change page1.aspx to use POST, it must be using
GET.

Given above condition, when I call Server.Transfer("/page2.aspx")
inside page1.aspx, how do I pass the name1=value1 to page2.aspx?

Thanks in advance.

CCY

Jan 5 '07 #1
2 7367
I've spent days trying out several different solutions to this problem. In
1.1, I never found a really satisfactory one outside programmatically
placing hidden text fields in your form. What I figured would work -
manually creating an HttpWebRequest and convert all query string values into
header values for a manual post - does not work, as there is only 1 request
thread per user, so your app will hang trying to spawn off the 2nd request
thread from the first. There's also using the Context to transfer the
values, but they won't survive a browser refresh. You could use ViewState,
but you need to stick with postbacks only, and if you go that route, you
might as well just interact with the controls themselves rather than futz
with viewstate.
Only thing I can really say to "fix" this (within 1.1; 2.0 gives better
control via Page.Form[]) is to change how you go from page-to-page, using
PostBacks and treating your app like a persistant page navigation app
instead of performing redirects or transfers. By going with that model, you
access all POSTed values via their ASP.Net control abstractions instead of
dealing with headers and key/value pairs (BTW: even in 1.1, you can still
grab these POSTed values by referencing their control names, as their
underlying header values are still in the request)

Jan 5 '07 #2
CCY
Thanks Keith, but I couldn't go with your suggestion because I have no
access to page2, and page1 is called with GET. I can't change these 2
conditions. I need to pass the "QueryString" received by page1 to
page2, and page2 must read it from "Form".
CCY

Jan 7 '07 #3

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

Similar topics

2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
4
by: Piotr Strycharz | last post by:
Hi all I do have a problem. How can I transfer user to another server using POST. The problem is that Server.Transfer (preserves form data) works just in current server. Response.Redirect -...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
6
by: Sundararajan | last post by:
Dear Folks, I have a hyperlink in my page - webform1.aspx on click of this i want it to post back to the second page -webform2.aspx. is this possible in ASP.Net 1.1. if so how can i go about it....
12
by: Britney | last post by:
Hi guys, in my default.aspx file, I have following code. when I go to browser, I enter values in both textboxs, then I hit submit Button, however, it didn't go to page2.aspx. instead, it was...
0
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
3
by: David Veeneman | last post by:
I am creating a form on the server that I want to POST to a URL that's being called with Server.Transfer(). What's the simplest way to do that? A little background: I'm programming buttons that...
4
by: David Veeneman | last post by:
I want to programmatically create some POST data on a web server, then pass that data to another web page that the server calls, using Server.Transfer(). What's the best way to do that? I'm...
9
by: Greg Stevens | last post by:
How do I specify that I want the data in a form to post to a DIFFERENT document? I've come across the Button.PostBackUrl property, but it is available in ASP.NET v. 2.0 only, and I'm using...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.