1

I'm using web browser to open a connection with Windows Mobile 6.5, however when I tried to read the value from the input text, I can not do this.

The way I open the web browser is the following:

webBrowser1.Navigate(new Uri("https://www.something.com"));

webBrowser1.DocumentCompleted += new webBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);

Is there another way to do this, with no webBrowser??

What I tried with no luck, for handle the html content is the following:

System.Windows.Forms.HtmlDocument document =
this.webBrowser1.Document; document.All["userName"].GetAttribute("value")))

It seems that even adding the reference to System.Windows.Forms in my solution, I'm not able to do it so.

Thanks in advance

1 Answer 1

0

Duplicate question, same as in Is there a way to obtain the HTML of a web page using the .NET compact framework? and different ones at stckoverflow.

You can not access the content of the html inside the webbrowser control. There are some workarounds like using HttpWebRequest and then load the result into the webbrower component to show to user. See also http://anoriginalidea.wordpress.com/2007/05/31/the-net-20-compact-framework-webbrowser-control/ and http://anoriginalidea.wordpress.com/?s=webby (serach results for webby".

There also weired workarounds using custom ActiveX that invokes into managed code and vice versa.

Javascript is a client side scripting code. why should one use the webbrowser control to control this javascript. It should be handled by the html/javascript code itself.

So, what is your intention?

3
  • Than you by your reply, what I want to do is to open a ie browser in the Windows Mobile app, once the app loads, this URL refers to a site which is used to log in the user then after validating that their credentials are correct, I want to get the user name and use it into my app. So the main issue I'm having is to get the user name from the form into the web page that URL's loads and get the user name after user entered into the input text, just a document.getElementById("username"), if it would be javascript. Kindest Regards
    – Angy
    Oct 27, 2014 at 17:14
  • You can use a form with input name and password and then a webrequest against the web server to validate the input. In this way you have full control on the user name supplied and the positive or negative webresponse.
    – josef
    Oct 27, 2014 at 18:03
  • Thank you so much @josef I'm going to try this option too.
    – Angy
    Oct 27, 2014 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.