1

I want to Navigate my web browser with a defined function like:

webbrowser1.navigate (my defined function);

This webbrowser is defined in a user control so that any one can change its default web page

How can I define a function by which the path sets?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Pedram
  • 728
  • 3
  • 10
  • 29

1 Answers1

2

Try following code:

HtmlElementCollection ele = this.webBrowserControl.Document.GetElementsByTagName("Form");  

foreach(HtmlElement currentElement in ele)
{
    currentElement.InvokeMember("submit");
}

OR

webbrowser.Document.All["ID OF ELEMENT"].InvokeMember("click");

Hope Its helpful.

Freelancer
  • 9,008
  • 7
  • 42
  • 81
  • you mean I do not need to use something like webbowser1.navigate(somestring)? imagine you do not know the html file's name – Pedram Apr 06 '13 at 06:53
  • you know some how its a usercontrol which is supposed to be add to a program – Pedram Apr 06 '13 at 06:53
  • :yeah,but its string is supposed to be changeable – Pedram Apr 06 '13 at 06:59
  • can you paste important part of your code, so that exact help can be given – Freelancer Apr 06 '13 at 07:02
  • public string LoadHTMLFilePath { get { string filepath = ""; return filepath; } set { string filepath; filepath = value; } If this document returns the string of navigation my problem will be solved – Pedram Apr 06 '13 at 07:23
  • Ohh, It will require to debugg your application and see from where actually values are comming and how they are got set to it. – Freelancer Apr 06 '13 at 07:27
  • Actually i am sorry, i could not provide you exact help. – Freelancer Apr 06 '13 at 07:38