Passing values from Windows Form to Web Form 
Author Message
 Passing values from Windows Form to Web Form

Hi,

We are using Process.Start("www.somesite.com/login.aspx")
from within a Windows form and would like to pass values
to fields on the Web form we are launching.  Can anyone
please tell me if/how you can do this?

Additionaly, we'd like to know if we could fire a click
event for a button on the Web form.  (We are trying to
automatically login to our Website in a browser launched
from within a Windows form.)

Thanks in advance for any help!



Sun, 26 Jun 2005 04:26:08 GMT  
 Passing values from Windows Form to Web Form
You can pass the data using the "get" method by appending the data to the
end of the URL, as the querystring. For example,

www.website.com/login.aspx?parm1=data1&parm2=data2

As for your second question, you can use the functionalities exported by
the Microsoft Internet Controls (shdocvw.dll). This is a COM component and
you should access it via Interop (Add a reference to it via the COM tab)

Here is the code snippet:

ie = New SHDocVw.InternetExplorer()
ie.Visible = True
ie.Navigate2("http://<server>/navpost.asp")

Dim doc As mshtml.HTMLDocument
doc = ie.Document
Dim submitBtn As mshtml.HTMLInputElement
submitBtn = CType(doc.getElementById("cmdLogin"), mshtml.HTMLInputElement)

submitBtn.click()

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:46:25 GMT  
 Passing values from Windows Form to Web Form
Sorry that another COM component should be added as a reference is the
Microsoft HTML Object Library (mshtml.tlb)

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 17:00:35 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Passing values from Windows From to Web Form

2. passing values between web forms in ASP.NET

3. Pass form values to third party form?

4. Pass form values to third party form?

5. Windows Forms to ASPX Web forms?

6. Web Forms and Windows Forms

7. pass a form from web page to web page

8. pass a form from web page to web page

9. form VB form to web based form

10. Forms Collection: Using it to Open Forms by Passing the Form Name as a String Variable

11. passing focus info form form to form

12. Passing Value from Module Function to Form sub problem

 

 
Powered by phpBB® Forum Software