Monday, 15 April 2013

c# - webBrowser .Url is not being applied -


It's a mystery that I am updating my webbrowser1 control with my code like this:

  string hostname = textbox1.Text; WebBrowser1.Url = new Uri (@ "http: //mydomain/comp.php? Compname =" + hostname); WebBrowser1.Refresh ();  

Every funny number works fine. I also try the number only refreshes the Webbrozer with the final compname therefore:

1 set text box comp1 http: //mydomain/comp.php? Compname = comp1 goes on 2. Set text box comp2 http: //mydomain/comp.php? Compname = comp1 goes on 3. Set textbox comp3 goes to http: // mydomain /comp.php?compname=comp3 4. Set text box comp956 http: //mydomain/comp.php? Compname = goes to comp3 5. Set Textbox comp111 http: //mydomain/comp.php? Compname = comp111 goes to <6>

Try:

  webBrowser1.Stop (); WebBrowser1.Url = new Uri (@ "http: //mydomain/comp.php? Compname =" + hostname);  

instead of the old code


No comments:

Post a Comment