Post to Web Page 
Author Message
 Post to Web Page

How would I simulate the posting of one web page to another by
substituting the first page to a vb.net page and leaving the second
page as an .asp 3.0 page?
I would like the first web page to be a vb.net form, when the user
clicks a button on that form it posts to a standard web page that is
expecting 3 form variables ( userId, Password, DB).

The purpose behind this is we have a web application where users must
log in with their username and password. I would like to create an
admin page which will have a form where I can select any user and pass
their userid and password to the .asp page that is expecting these
variables.

I know I could do this by using all .asp but I would think there would
be a way using both vb.net and asp.

Thanks

Eric



Sun, 26 Jun 2005 04:10:03 GMT  
 Post to Web Page
You are talking about WebForm not WinForm in .Net I assume.

Just drop the submit button to the WebForm like what you are doing in ASP3.0
will work.

chanmm


Quote:
> How would I simulate the posting of one web page to another by
> substituting the first page to a vb.net page and leaving the second
> page as an .asp 3.0 page?
> I would like the first web page to be a vb.net form, when the user
> clicks a button on that form it posts to a standard web page that is
> expecting 3 form variables ( userId, Password, DB).

> The purpose behind this is we have a web application where users must
> log in with their username and password. I would like to create an
> admin page which will have a form where I can select any user and pass
> their userid and password to the .asp page that is expecting these
> variables.

> I know I could do this by using all .asp but I would think there would
> be a way using both vb.net and asp.

> Thanks

> Eric



Sun, 26 Jun 2005 08:27:40 GMT  
 Post to Web Page
Hi Eric,

You can use the POST method with the WebBrowser ActiveX control to send
data to an HTTP server such as Microsoft Internet Information Server (IIS).

To post data, you can use the Navigate or the Navigate2 method of the
WebBrowser control in which only the URL, PostData, and Headers parameters
are relevant.

To call Navigate and post form data to an HTTP server, ensure that the
parameters include the following information:
1. The URL parameter must specify a valid address.
2. The PostData parameter must contain an array of bytes.
3. The Headers parameter must contain the following HTTP header:

Content-Type: application/x-www-form-urlencoded

This header indicates that the data that is posted is encoded according to
the Hypertext Markup Language (HTML) specification.

NOTE: The Microsoft Internet Explorer Script Object Model has a Window
object, which also has a Navigate method. However, the Navigate method of
this Window object only accepts a URL. Furthermore, you cannot use this
Navigate method to post data to a Web server.

Here is the code snippet:

Dim vPost As Object
Dim vHeaders As Object
Dim cParamName As String
Dim cParamPwd As String
Dim cPostData As String
Dim cSeparator As String

cParamName = "User="
cSeparator = "&"
cParamPwd = "Pwd="

cPostData = cParamName & txtBoxName.Text & cSeparator & cParamPwd &
txtPassword.Text
vHeaders = "Content-Type: application/x-www-form-urlencoded" + Chr(10) +
Chr(13)
vPost = ASCIIEncoding.ASCII.GetBytes(cPostData)
AxWebBrowser1.Navigate2("http://<server>/navpost.asp", , , vPost, vHeaders)

Here the AxWebBrowser1 is the name of the WebBrowser ActiveX control on the
VB Form. The ASCIIEncoding class provides a method to convert string into
an array of bytes.

Gary

This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://www.asp.net



Sun, 26 Jun 2005 16:33:12 GMT  
 Post to Web Page
I am using a VB.Net Winform.  I am sure there are easier ways but I
want to know if its possible to make it work this way.
Quote:

> You are talking about WebForm not WinForm in .Net I assume.

> Just drop the submit button to the WebForm like what you are doing in ASP3.0
> will work.

> chanmm



> > How would I simulate the posting of one web page to another by
> > substituting the first page to a vb.net page and leaving the second
> > page as an .asp 3.0 page?
> > I would like the first web page to be a vb.net form, when the user
> > clicks a button on that form it posts to a standard web page that is
> > expecting 3 form variables ( userId, Password, DB).

> > The purpose behind this is we have a web application where users must
> > log in with their username and password. I would like to create an
> > admin page which will have a form where I can select any user and pass
> > their userid and password to the .asp page that is expecting these
> > variables.

> > I know I could do this by using all .asp but I would think there would
> > be a way using both vb.net and asp.

> > Thanks

> > Eric



Sun, 26 Jun 2005 20:58:22 GMT  
 Post to Web Page
Hi Eric,

Have you tried my suggestion?

Gary

This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://www.asp.net



Tue, 28 Jun 2005 10:31:43 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Post to Web Page

2. web page that post from a single page

3. pass a form from web page to web page

4. pass a form from web page to web page

5. Post data from one page to another (BOA page) vb.net

6. Post Data from page to another (BOA page) in vb.net

7. passing variable argument list from web page to web service (is it possible)

8. Size of web page in web browser object

9. Uploading a file Web Page to the Web Server

10. Printing a Web Page in Web Browser Control

11. Help saving web page with web control?

12. Page Breaks in Web Page

 

 
Powered by phpBB® Forum Software