Question WebBrowser Control stripping out query string

gchq

Well-known member
Joined
Dec 14, 2007
Messages
168
Programming Experience
10+
Hi there.

When a WebBrowser controls loads and navigates to a page it strips out everything after the '?'

Any idea how to overcome this and pass the query string to the page?

Thanks
 
When a WebBrowser controls loads and navigates to a page it strips out everything after the '?'
Not that I can see, it don't. Do you have more information on how this appears to you?
 
VB.NET:
Dim vURLString As String = "https://mysite.com/Manager_Utilities/Webpage.aspx?PageID=" & Page_ID & "&UserID=" & vUserID & "&HOAID=" & HOAID & "IDString=" & TempKey
        Dim vURL As New Uri(vURLString)
        Dim vBrowser As New WebBrowser
        With vBrowser
            .Dock = DockStyle.Fill
            .Navigate(vURL)
        End With

Have tried with and without Uri, and a myriad combinations, but always get just

https://mysite.com/Manager_Utilities/Webpage.aspx?

as the url....
 
OK - now that it's morning and I've looked at it again, I missed out an '&' in the string - it now works.. Sigh

Thank you for responding...
 
I'd use String.Format here, like this:
VB.NET:
vURLString = String.Format("https://mysite.com/Manager_Utilities/Webpage.aspx?PageID={0}&UserID={1}&HOAID={2}&IDString={3}", Page_ID, vUserID, HOAID, TempKey)
btw, added the missing & to this code too, it was easy to spot now without all those string concat operators everywhere :)
 
Back
Top