473,830 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I submit a form and then do a response.redire ct?

Hi all. I'm really stuck here, and would greatly appreciate any help or
suggestions.

I'm trying to (from the server side) submit the page that is loading to a
new window, then redirect to another form.

What I'm trying to do would look like:

protected void Page_Load(objec t sender, EventArgs e)
{
form1.hiddenFie ld1.Value = Request["ccvalue1"];
form1.hiddenFie ld2.Value = Request["ccvalue2"];

form1.Target="_ blank";
form1.Submit();

Response.Redire ct("default.asp x");
}

The reason I'm doing this is because ASP.NET changes the ID's of hidden
fields that belong to a page with a master template, and I need to submit to
a credit card pay page that is expecting specially named hidden form fields.
This page is a dummy page (without a master template page) that receives
values from an order wizard then loads the values into the hidden fields on
the dummy page's load and submits itself to the credit card pay page in a
new window and then redirects itself to "default.as px", the user's home
page.
Thanks again for any suggestions.
Trevor Braun
Apr 17 '06 #1
3 2895
The strategy you are trying to implement would work but i might suggest
that you take a look at the HttpWebRequest class (net framework
System.Net). With an object of this class you can call the credit card
page submitting all the fields you need (with POST method) and get the
output returned by the credit card page. You would be able to do this
within the same page in your application (without the need of opening
another browser window).

You can find more information here:

http://www.netomatix.com/HttpPostData.aspx

and here

http://msdn2.microsoft.com/en-us/lib...st(VS.80).aspx

Regards

Apr 17 '06 #2
The strategy you are trying to implement would work but i might suggest
that you take a look at the HttpWebRequest class (net framework
System.Net). With an object of this class you can call the credit card
page submitting all the fields you need (with POST method) and get the
output returned by the credit card page. You would be able to do this
within the same page in your application (without the need of opening
another browser window).

You can find more information here:

http://www.netomatix.com/HttpPostData.aspx

and here

http://msdn2.microsoft.com/en-us/lib...st(VS.80).aspx

Regards

Apr 17 '06 #3
Thanks. That sounds like an excellent solution, but I don't know if will
fit what I need to do. The credit card information actually gets entered
into the new window, the only thing I submit to the pay page are three
hidden fields (two identify the company, the third holds the amount to be
charged to the card.)

I'll play around with it and see if I can't get something working.

Trevor Braun
"Neutrino" <ne*********@ya hoo.com> wrote in message
news:11******** *************@i 40g2000cwc.goog legroups.com...
The strategy you are trying to implement would work but i might suggest
that you take a look at the HttpWebRequest class (net framework
System.Net). With an object of this class you can call the credit card
page submitting all the fields you need (with POST method) and get the
output returned by the credit card page. You would be able to do this
within the same page in your application (without the need of opening
another browser window).

You can find more information here:

http://www.netomatix.com/HttpPostData.aspx

and here

http://msdn2.microsoft.com/en-us/lib...st(VS.80).aspx

Regards

Apr 17 '06 #4

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

Similar topics

3
2089
by: Matt | last post by:
When people say submit the form data, does it mean the form data are submitted to web browser using either HTTP GET or POST method, and then it will redirect to another page. For example, this is page1.aspx <form action="page2.aspx" method="post"> means it will submit the page1.aspx form data to the web server, and then redirect from page1.aspxto page2.aspx?
6
3109
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form should be submitted as if the button is pressed. Is this correct? Does this behaviour vary across browsers? Chris
1
8468
by: Frawls | last post by:
Hi Can any one give me some help with this problem please? Here is the scenario: A user submits page 1 which is a web form. After the form has been submitted they are (redirected) onto the next page, page 2.
2
3845
by: Frawls | last post by:
Hi Can any one give me some help with this problem please? Here is the scenario: A user submits page 1 which is a web form.
5
10991
by: Scott | last post by:
How can I tell a form to submit itself in the code-behind in vs.net? In other words, in javascript I can do blah.submit() - how do I do this in vs.net code-behind?
3
2261
by: Chung | last post by:
Hi all, I have used the following code for doing the form submission. I don't think this is a right way to submit a from to a new aspx page because I need to add a dummy form in between. Could anyone tell me a proper way to do this? Looking forward to your reply. Thanks!
3
2051
by: Athmaus | last post by:
Hello, I have this ecom page that i am making where customers can select to choose additional licenses before they purchase. I have that part working with javascript. Problem is that when the selection is made and you hit the add but it isn't sending to the right pages (and i think i need to do it in another statemen instead of a if..then, since there will be at least 16 conditions here.
6
1848
by: Ellie | last post by:
How can I force a submit on a form. I want to load a form but then I want to close it and have it do something and then redirect it. This is ASP 3.0. thanks
1
2364
by: valmae | last post by:
Please help anyone! I am getting this error after the submit button is clicked to this form which was designed in Dreamweaver in ASP. Microsoft VBScript compilation error '800a0401' Expected end of statement /Prepare/Earthquake_Awareness_Week_07/Earthquake_drill.asp, line 37 wareness Week Response Form</u></h1><h2>Superintendents Name: </h2>" & request.form("Superintendents Name") _
0
9786
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
10769
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
10479
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
10523
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
6948
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();...
0
5616
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4409
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3956
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3073
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.