473,387 Members | 1,673 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,387 software developers and data experts.

Redirecting to another server

9
Hi,

I have the following requirement wherein I have a webform with webcontrols in it . While the original requirement is to database operations with it the new requirement is to along with inserting in db the webform's html needs to be sent to a different server.

The new requirement needs me to send the webforms resulting html to be sent to a different webserver(essentially a https:// web site).

Right now I have the page output(HTML) as a stirng but not sure to redirect to another server because when I use the following code: the control goes to the other server(obviously) but I need the control back to the current site to do some operations like displaying message to user etc.

Dim hRequest As HttpWebRequest = WebRequest.Create(sHtmlString)
hRequest .Method = "POST"
hRequest .ContentType = "application/x-www-form-urlencoded"
Dim sRequestStream As Stream = hRequest .GetRequestStream()
Dim postBytes As Byte()
Dim e As New System.Text.ASCIIEncoding
postBytes = e.GetBytes(sHtmlString

sRequestStream.Write(postBytes, 0, postBytes.Length)
sRequestStream.Close()

HttpContext.Current.Response.Redirect(URL, True)

Can anybody advise me to do how to go about it



Thanks in advance
Feb 8 '08 #1
1 932
gvi
9
Hi,

I have the following requirement wherein I have a webform with webcontrols in it . While the original requirement is to database operations with it the new requirement is to along with inserting in db the webform's html needs to be sent to a different server.

The new requirement needs me to send the webforms resulting html to be sent to a different webserver(essentially a https:// web site).

Right now I have the page output(HTML) as a stirng but not sure to redirect to another server because when I use the following code: the control goes to the other server(obviously) but I need the control back to the current site to do some operations like displaying message to user etc.

Dim hRequest As HttpWebRequest = WebRequest.Create(URL)
hRequest .Method = "POST"
hRequest .ContentType = "application/x-www-form-urlencoded"
Dim sRequestStream As Stream = hRequest .GetRequestStream()
Dim postBytes As Byte()
Dim e As New System.Text.ASCIIEncoding
postBytes = e.GetBytes(sHtmlString

sRequestStream.Write(postBytes, 0, postBytes.Length)
sRequestStream.Close()

HttpContext.Current.Response.Redirect(URL, True)

Can anybody advise me to do how to go about it



Thanks in advance
Feb 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: David E. Smith | last post by:
I want to redirect input from one page to another, but it's POST content. If it were GET, I could just do something like: header("Location: /new/form.php?a=1&b=2") I can't rewrite the...
1
by: Ankur Jain | last post by:
Hi, I am facing a very weird problem while redirecting to another page. The problem is as follows: I have a website. I build the solution and run the application. The first page is the login...
1
by: Bilbo | last post by:
Hello, How do I programatically redirect a page in "another frame" using C# in ASP.NET? Server.Transfer redirects the current page...not a different frame. Thanks.
2
by: Jorge Matos | last post by:
I think the answer is no, but I wanted to ask to be sure. Is it possible to handle an exception in Page_Error or Application_Error and not redirect to a custom error page? In other words I want...
4
by: Greg Smalter | last post by:
Redirecting from page to page within a web project is pretty easy. However, all Redirect methods take strings as arguments, as if you mistype the string, you don't find out until run time that you...
41
by: amygdala | last post by:
Hello all, I have posted a similar question in comp.lang.php in the past, but haven't had any response to it then. I kinda swept the problem under the rug since then. But I would really like to...
9
by: Jonathan Wood | last post by:
I've spent days trying to come up with a solution. I'd appreciate it if anyone can help. My site requires all users to log on. There are three different roles of users, and each user type will...
2
by: pvenkatesh2k4 | last post by:
hi to all i am new to Web development. i started with simple page in which i decided to click on one page should move to another page along with the posted values. my code is: </head> <body> ...
1
by: barunva | last post by:
Hi All, Can you please answer my following question: I have two web servers; one is based on Linux Operating System and the second one is based on AIX OS, and both are geographically apart,...
0
by: embeddedbob | last post by:
Hi there, I appreciate any help on the following issue. I can't seem to find any other similar topic. (CS4, ActionScript 3.0, Flash 10) I have a SWF embedded within a page that is protected by...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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,...

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.