Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 21st, 2008, 07:15 AM
Authorized User
Points: 292, Level: 5
Points: 292, Level: 5 Points: 292, Level: 5 Points: 292, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Form post page redirect problem - S.O.S.

I need to post information to a database hosted by another webhost, however I want my page to actually redirect to my own site.

I have a "receipt" that I host and need to display to the visitor (I also host the shopping cart), but data that needs to go to my client's web server at the same time.

I appreciate any and all help!!
  #2 (permalink)  
Old May 21st, 2008, 07:26 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I am not sure if you have a question here or if you are wondering if there are any implications in doing things this way.

In any event, this is a fairly "normal" setup in that you have a seperation between your webserver and database server. What you would do is something like:

protected void Submit_Click(object sender, EventArgs e)
{
   //Do some processing
   //Build a connection to the database;
   //Pass in the connection requirements for your remote database server
   //in the connection string

   //Clean up
   //Do something else
}

If your client is using SQL Server you will need to make sure that their box is configured to allow remote connections.

hth.
-Doug

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
  #3 (permalink)  
Old May 21st, 2008, 08:35 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

From the sounds of the question you have a remote web site that has a page that requires a POST to it to capture some data. However, you don't want the user's browser to be sent to that page.

You could use the HttpWebRequest class to construct an HTTP request that includes the POST data and posts that to the page from your application. This eliminates the user's browser from the process all together.

-Peter
compiledthoughts.com
  #4 (permalink)  
Old May 21st, 2008, 08:45 AM
Authorized User
Points: 292, Level: 5
Points: 292, Level: 5 Points: 292, Level: 5 Points: 292, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's exactly right. I want MY receipt to be the visitor's last page, but need the data posted to my client's web server. I don't want MY visitor to end up on my client's site, only the order.

How would I go about creating a HttpWebRequest?

Thanks!

Quote:
quote:Originally posted by planoie
 From the sounds of the question you have a remote web site that has a page that requires a POST to it to capture some data. However, you don't want the user's browser to be sent to that page.

You could use the HttpWebRequest class to construct an HTTP request that includes the POST data and posts that to the page from your application. This eliminates the user's browser from the process all together.

-Peter
compiledthoughts.com
  #5 (permalink)  
Old May 21st, 2008, 11:06 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

http://www.google.com/search?q=using+HttpWebRequest

-Peter
compiledthoughts.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
Post to Another Page problem Indo77 ASP.NET 2.0 Basics 2 March 8th, 2007 05:31 PM
How redirect to a new page after submit form... sevtov Beginning PHP 4 February 12th, 2007 06:49 AM
Form Validation and Redirect Page jourys ASP.NET 1.0 and 1.1 Basics 1 February 24th, 2006 12:20 PM
POST values and redirect brettk_1 ASP.NET 1.0 and 1.1 Professional 1 January 30th, 2006 08:04 AM
POST values and redirect brettk_1 ASP.NET 2.0 Professional 1 January 30th, 2006 08:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.