473,659 Members | 2,667 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I transfer user to another server after POST

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.Redire ct - uses GET method. However I have to open remote server
page using POST method. Normally this can be achieved using <form
ACTION="remote-page-url"> tag. However this is impossible with ASP.NET.
Also, using WebRequest class is not good solution, as I can post to and read
data from remote server, but user browser itselft is still connected to my
server.

Regards.
Nov 18 '05 #1
4 2875
TYhis is not an ASP.NET limitation (an "ASP.NET" page is anyway just an
HTML Page). At worst you could do something like a pure HTML Page that
contains the data as hidden field and that posts to the target page when
loaded...

That said I'm not sure it works (depending perhaps on user settings) as IMO
posting accross domains may sometimes be blocked ?

What thinks the owner of the page. Perhaps could a provide a GET version ?

Patrice

"Piotr Strycharz" <Pi************ *@antispam-account.com> a écrit dans le
message de news:c6******** **@nemesis.news .tpi.pl...
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.Redire ct - uses GET method. However I have to open remote server
page using POST method. Normally this can be achieved using <form
ACTION="remote-page-url"> tag. However this is impossible with ASP.NET.
Also, using WebRequest class is not good solution, as I can post to and read data from remote server, but user browser itselft is still connected to my
server.

Regards.

Nov 18 '05 #2

Użytkownik "Patrice" <no****@nowhere .com> napisał w wiadomo¶ci
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
TYhis is not an ASP.NET limitation (an "ASP.NET" page is anyway just an
HTML Page).
Well - actually it is. I cannot provide my ACTION element in FORM
What thinks the owner of the page. Perhaps could a provide a GET version ?


Not possible. It is credit card verifier that allows parameters only as POST
data due to security reasons.

Piotr

Nov 18 '05 #3
Sorry, I meant actually this is not an *HTML* limitation. Let's proceed with
take 2 hopefully more clearly.

You could then change the action attribute client side using JavaScript.

My first suggestion expressed more clearly was to create an HTML page by
yourself (using response.write) . You could keep your current ASP.NET page
and on postback response.write those fields as hidden value on a page that
is immediatly submitted (using JavaScript)...

As a side note, I don't really understand why the user should be really
directed to the verification site. Shouldn't the verification process be
transparent to the user and see he is still on your site ?

Patrice
"Piotr Strycharz" <Pi************ *@antispam-account.com> a écrit dans le
message de news:c6******** **@atlantis.new s.tpi.pl...

Użytkownik "Patrice" <no****@nowhere .com> napisał w wiadomo¶ci
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
TYhis is not an ASP.NET limitation (an "ASP.NET" page is anyway just an
HTML Page).
Well - actually it is. I cannot provide my ACTION element in FORM
What thinks the owner of the page. Perhaps could a provide a GET version

?
Not possible. It is credit card verifier that allows parameters only as POST data due to security reasons.

Piotr

Nov 18 '05 #4
You can create the post yourself
Here's some code I use to post a credit card transaction, which returns to
the caller. You can then redirect to an acknowledgement page:

Private Function viaKlixPostTran saction(ByVal trans As
viaKlixTransact ion) As String
modErr.EnterFun ction("OrderFor m.aspx.vb.viaKl ixPostTransacti on")
Dim sbldr As New StringBuilder
Dim params As NameValueCollec tion = trans.GetValues
Dim iEnum As IEnumerator = params.Keys.Get Enumerator

' Build the request string from the parameters
Do While iEnum.MoveNext
Dim sKey As String = iEnum.Current
If Not params.Item(sKe y) Is Nothing AndAlso
params.Item(sKe y).ToString <> "" Then
sbldr.Append(sK ey)
sbldr.Append("= ")
sbldr.Append(Se rver.UrlEncode( params.Item(sKe y)))
sbldr.Append("& ")
End If
Loop
sbldr.Remove(sb ldr.Length - 1, 1) 'Remove trailing "&"

'Post the request
Dim dataResponse As String
Dim dataBody As String = sbldr.ToString
Dim webResponse As HttpWebResponse
Dim webRequestStrea m As System.IO.Strea m
Dim webRequest As HttpWebRequest
Dim responseStream As Stream

' Create the RequestStream
Try
webRequest =
webRequest.Crea te("https://www2.viaklix.co m/process.asp")

' Note - "KeepAlive = False" seems to be needed to avoid errors,
apparently caused by the client
' (this application) thinking the connection is being
maintained while the server or
' firewall may disconnect it. Apparently, if the client
doesn't maintain it, it will know
' enough to re-establish it when it needs it.
webRequest.Keep Alive = False

webRequest.Meth od = "POST"
webRequest.Cont entType = "applicatio n/x-www-form-urlencoded"

' Create request body
webRequest.Cont entLength = dataBody.Length
webRequestStrea m = webRequest.GetR equestStream()
Catch ex As Exception
modErr.WriteLog ("Creating RequestStream: " & ex.ToString, 0)
End Try

' Write the WebRequest
Try
Dim writer As New StreamWriter(we bRequestStream)
writer.Write(da taBody)
'TODO - writer.close can probably go into a Finally block...
Try 'Getting an exception on this shouldn't stop us...
writer.Close() 'Closes the StreamWriter and the underlying
stream
Catch ex As Exception
modErr.WriteLog ("Writer.Clo se: " & ex.ToString, 0)
End Try

Catch ex As Exception ' Catches error on writer.write
modErr.WriteLog (ex.ToString, 0)
modErr.WriteLog (dataBody, 1) 'Looking for data dependency
modErr.ExitFunc tion()
Return Nothing

End Try

' Get the response from viaKlix
Try
webResponse = webRequest.GetR esponse()
responseStream = webResponse.Get ResponseStream( )

Dim readStream As New System.IO.Strea mReader(respons eStream)
dataResponse = readStream.Read ToEnd

readStream.Clos e() 'Closes the StreamReader and the underlying
stream

modErr.ExitFunc tion()
Return dataResponse

Catch ex As Exception
modErr.WriteLog ("Reading Response: " & ex.ToString, 0)
modErr.ExitFunc tion()
Return Nothing
End Try

End Function

"Piotr Strycharz" <Pi************ *@antispam-account.com> wrote in message
news:c6******** **@atlantis.new s.tpi.pl...

Użytkownik "Patrice" <no****@nowhere .com> napisał w wiadomo¶ci
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
TYhis is not an ASP.NET limitation (an "ASP.NET" page is anyway just an
HTML Page).
Well - actually it is. I cannot provide my ACTION element in FORM
What thinks the owner of the page. Perhaps could a provide a GET version

?
Not possible. It is credit card verifier that allows parameters only as POST data due to security reasons.

Piotr

Nov 18 '05 #5

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

Similar topics

2
2797
by: Philip Korolev | last post by:
Hi All. I am attempting to use SSL for the first time with ASP.NET I would like to be able to send my form details to another page using https:// connection. The page I am sending data to, uses Stored Procedures to add data to SQL Server. However attempting to use https:// in server.transfer (qualifying a full address) is returning an error. How can I use SSL with ASP.NET page transfers? If there is more than one technique, I would appreciate...
6
2234
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 site on its own, so I will end up having two web sites. This planned to aid problems we've been having with performance, as if the portion (which is an app in its own right) has problems we then have to restart the whole site and so bring everything...
5
7400
by: Tom | last post by:
Hi I am trying to transfer to a different .ASPX page using Server.Transfer. However, I get the following error: "Error executing child request for .aspx." Anyone know why? Thanks for help.
3
2134
by: Manuel Lopez | last post by:
Hello, We have two applications that will reside on the same webserver. We want to be able to post from pages in App1 to to pages in App2. We need to pass sensible data, so we cannot use querystring. We are using server.transfer (needing to reference App2 in App1).
5
7816
by: Julien C. | last post by:
Hi all, I have an "EditeItem.aspx" page which lets me edit properties of an "Item". In the OnClick() event of my Save button, I do save Item changes to the database and then I redirect the user to the Item page "ViewItem.aspx" with a simple : Server.Transfer("ViewItem.aspx"); I'd like to pass another HTTP parameter so that in the "ViewItem.aspx" page,
2
3372
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 for the web site are held in a database and all the labels, buttons etc are populated at run time in the Page_Load handler. The retreval of the strings from the database is all
2
4332
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control displaying the contents of the data source, whilst another control updates the datasource via a command buttons implementation of 'Click', an event raised in the 'Handle Postback Events' stage of the control execution life cycle (via the...
5
2572
by: Guadala Harry | last post by:
I've been reading up on Server.Transfer as well as doing some testing, and it appears to always raise the ThreadAbortException error. On one hand I've read a bunch of promotional-type material touting the benefits of Server.Transfer and none of them mention ThreadAbortException - but the MSDN documentation says Server.Transfer will always cause that exception - by design - and that the work-around is to not use Server.Transfer (and to use...
4
2149
by: Keith Patrick | last post by:
I have an app where a Shockwave splash animation starts off my app and then sets its parent iframe's src to the value of a default page "BasicReports". BasicReports has a link to another report page, but when I click it and redirect via Server.Transfer (using both values for preserveForm), the first time, it loads up BasicReports again. If I click BasicReports *again*, then it transfers to the correct page. Is there a known behavior/bug...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8535
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.