473,405 Members | 2,349 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,405 software developers and data experts.

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 1557
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
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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
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...

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.