473,499 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tough redirection question

Hi,

Is it possible to do a form POST and also redirect to a different url,
using code behind?

I don't think response.redirect will work because that doesn't post
form data.
I don't think server.transfer will work because that doesn't redirect
to a different url.
I don't think HttpWebRequest will work because that doesn't redirect
to the url, it only posts data to it.

I want to have an code behind asp.net button called "Pay", and when
you click on it, it redirects to a credit card payment site, with the
form's data posted to this website, such as the total amount, etc,
etc.

The cc payment site expects an old fashioned form post btw.

Is a code behind solution not possible?

Thanks for any expert opinion.

-dnw.
Nov 18 '05 #1
5 1560
The limitation of one form on an ASP.NET page is limited only to those
that you wish to control via ASP.NET. I would suggest putting in a
normal HTML form with an action to wherever you want and a method of
POST. No server side interaction will be done - and I assume this is
what you want.

On 11 Apr 2004 09:13:42 -0700, do***@hotmail.com (Dot net work) wrote:
Hi,

Is it possible to do a form POST and also redirect to a different url,
using code behind?

I don't think response.redirect will work because that doesn't post
form data.
I don't think server.transfer will work because that doesn't redirect
to a different url.
I don't think HttpWebRequest will work because that doesn't redirect
to the url, it only posts data to it.

I want to have an code behind asp.net button called "Pay", and when
you click on it, it redirects to a credit card payment site, with the
form's data posted to this website, such as the total amount, etc,
etc.

The cc payment site expects an old fashioned form post btw.

Is a code behind solution not possible?

Thanks for any expert opinion.

-dnw.


Nov 18 '05 #2
The limitation of one form on an ASP.NET page is limited only to those
that you wish to control via ASP.NET. I would suggest putting in a
normal HTML form with an action to wherever you want and a method of
POST. No server side interaction will be done - and I assume this is
what you want.

On 11 Apr 2004 09:13:42 -0700, do***@hotmail.com (Dot net work) wrote:
Hi,

Is it possible to do a form POST and also redirect to a different url,
using code behind?

I don't think response.redirect will work because that doesn't post
form data.
I don't think server.transfer will work because that doesn't redirect
to a different url.
I don't think HttpWebRequest will work because that doesn't redirect
to the url, it only posts data to it.

I want to have an code behind asp.net button called "Pay", and when
you click on it, it redirects to a credit card payment site, with the
form's data posted to this website, such as the total amount, etc,
etc.

The cc payment site expects an old fashioned form post btw.

Is a code behind solution not possible?

Thanks for any expert opinion.

-dnw.


Nov 18 '05 #3
Here's some ideas for you.
1) Output an old fashioned non-server form to the client (without the runat=
'server' attribute) Set the action attribute like you would have in
ASP.OLD, and use javascript to submit the form.
2) use client side script to change your ASP.NET form action attribute
3) use this webform control: http://www.wilsondotnet.com/Controls/

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Dot net work" <do***@hotmail.com> wrote in message
news:77**************************@posting.google.c om...
Hi,

Is it possible to do a form POST and also redirect to a different url,
using code behind?

I don't think response.redirect will work because that doesn't post
form data.
I don't think server.transfer will work because that doesn't redirect
to a different url.
I don't think HttpWebRequest will work because that doesn't redirect
to the url, it only posts data to it.

I want to have an code behind asp.net button called "Pay", and when
you click on it, it redirects to a credit card payment site, with the
form's data posted to this website, such as the total amount, etc,
etc.

The cc payment site expects an old fashioned form post btw.

Is a code behind solution not possible?

Thanks for any expert opinion.

-dnw.

Nov 18 '05 #4
Hi,

Much appreciate all replies.

Under the asp.net "Pay" button, I think I might need a mixture of code
behind and client side programming?

ASPNET_Pay_Button_Click
If the user needs to do something different then
response.redirect("Another server side aspx form") 'In other words,
carry on doing typical asp.net server side type activities
else if the user wants to go ahead and pay me then
redirect and post some data using the asp.old way to a payment
website
else
'more code behind programming goes here.

Is it possible to get any of your client side suggestions inside the
code behind pay button so that I can post and redirect to the payment
website?

(I'd buy the component mentioned, but I haven't got a spare $50 at the
moment.)

-dnw.
do***@hotmail.com (Dot net work) wrote in message news:<77**************************@posting.google. com>...
Hi,

Is it possible to do a form POST and also redirect to a different url,
using code behind?

I don't think response.redirect will work because that doesn't post
form data.
I don't think server.transfer will work because that doesn't redirect
to a different url.
I don't think HttpWebRequest will work because that doesn't redirect
to the url, it only posts data to it.

I want to have an code behind asp.net button called "Pay", and when
you click on it, it redirects to a credit card payment site, with the
form's data posted to this website, such as the total amount, etc,
etc.

The cc payment site expects an old fashioned form post btw.

Is a code behind solution not possible?

Thanks for any expert opinion.

-dnw.

Nov 18 '05 #5
I think I've done it. (Critical comments are very welcome.)

Under the asp.net "Pay" button, you can have the following code behind
code:

ASPNET_Pay_Button_Click
If the user needs to do something different then
response.redirect("Another server side aspx form") 'In other words,
just carry on doing typical asp.net server side type activities
else if the user wants to go ahead and pay me then
Response.Write("<form name='Form1' action='http://www.domain.com'
method='POST' >")
Response.Write("<input type='hidden' name='SomeDataThatNeedsPosting'
value='12345' >") 'The nice thing about this is that you can
construct the html values at run time using code behind.
Response.Write("</form>")
Response.Write("<script>")
Response.Write("document.Form1.submit();")
Response.Write("</script>")
else
'more code behind programming goes here.

Thank you for all help.

-dnw.
do***@hotmail.com (Dot net work) wrote in message news:<77**************************@posting.google. com>...
Hi,

Much appreciate all replies.

Under the asp.net "Pay" button, I think I might need a mixture of code
behind and client side programming?

ASPNET_Pay_Button_Click
If the user needs to do something different then
response.redirect("Another server side aspx form") 'In other words,
carry on doing typical asp.net server side type activities
else if the user wants to go ahead and pay me then
redirect and post some data using the asp.old way to a payment
website
else
'more code behind programming goes here.

Is it possible to get any of your client side suggestions inside the
code behind pay button so that I can post and redirect to the payment
website?

(I'd buy the component mentioned, but I haven't got a spare $50 at the
moment.)

-dnw.
do***@hotmail.com (Dot net work) wrote in message news:<77**************************@posting.google. com>...
Hi,

Is it possible to do a form POST and also redirect to a different url,
using code behind?

I don't think response.redirect will work because that doesn't post
form data.
I don't think server.transfer will work because that doesn't redirect
to a different url.
I don't think HttpWebRequest will work because that doesn't redirect
to the url, it only posts data to it.

I want to have an code behind asp.net button called "Pay", and when
you click on it, it redirects to a credit card payment site, with the
form's data posted to this website, such as the total amount, etc,
etc.

The cc payment site expects an old fashioned form post btw.

Is a code behind solution not possible?

Thanks for any expert opinion.

-dnw.

Nov 18 '05 #6

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

Similar topics

8
5972
by: Manu | last post by:
Hi there, I am using a perl script to generate this html page which just redirects users to my ftp server. The problem is I get a "page cannot be displayed" in IE 6.0 (haven't tried other...
2
4682
by: Rick N. Backer | last post by:
Hello folks, Novice type question here. I'm working with a very simple app here that takes a series of strings from the console. Once the end user has finished inputting the strings they are...
52
5383
by: Gerard M Foley | last post by:
Can one write a webpage which is not displayed but which simply redirects the user to another page without any action by the user? Sorry if this is simple, but I am sometimes simple myself. ...
7
2101
by: Steph | last post by:
Bonjour, Je souhaite lancer une redirection vers un fichier php via SRC= dans une condition if (voir ci-dessous en bas du script) mais la redirection ne fonctionne pas. Par contre la condition...
2
2904
by: John Drako | last post by:
I have a database with a lot of links. Every so often I run a script to verify if the URLs are still valid. I weed out the ones with the 404 response. However, many responses are of the 303 kind...
9
17807
by: denis | last post by:
Hi there, I got a tough interview questions lately, and I would like to hear your opinion: An array of N chars is given Write an efficient algorithm to find all the repeating substring with a ...
13
2677
by: souissipro | last post by:
Hi, I have written a C program that does some of the functionalities mentionned in my previous topic posted some days ago. This shell should: 1- execute input commands from standard input,...
1
1712
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...
3
1574
by: postindex | last post by:
Can I get whole commandline not only argument list. 1. When I command like this $ a.py filename 2. sys.argv is returns only argument list Is there a way to find out 'redirection'...
4
1942
by: Jim Rutledge | last post by:
ok ok , anyone know anything on this tough question? How do you determine the length in seconds that a midi file is , or any audio file for that matter ?
0
7134
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,...
0
7180
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,...
0
7229
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...
1
6905
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...
0
5485
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,...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4609
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...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
311
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...

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.