Silverlight – WebBrowser controls and query strings WP7

I use the WebBrowser control to start and browse some html files loaded locally in the Windows Phone 7 emulator and the device. Everything is normal until we use the query string for web page navigation. javascript is required I read these query strings, but the navigation completely fails when the query string is included. Without the query string, the navigation works fine.

I stick to this for a long time and I really appreciate it Your thoughts.
Tony

I can’t find the query string passed to the local HTML file method. (I copy the HTML file to isolated storage and view it from there.)

However…
I can successfully navigate to the local HTML file and specify the fragment. If the fragment contains The equal sign (=) and the ampersand (&), it can even work, so you can do this:

webBrowser1.Navigate(new Uri("index.html#123 =abc&456=def", UriKind.Relative));

And get the value in the following ways


< br />




Display the following content on the page (in the browser control).

123=abc&456=def 

(Obviously you can do more appropriate things with the value in javascript as needed.)

Yes, you can use fragent like a query string.

< p> Obviously, as long as you don’t need to use it at the same time So, it can work normally.

I use the WebBrowser control to launch and browse some html files loaded locally in the Windows Phone 7 emulator and device. Everything is normal, Until we use the query string for web page navigation. javascript needs to read these query strings, but the navigation fails completely when the query string is included. Without the query string, the navigation works fine.

I Stick to this for a long time, really appreciate your thoughts.
Tony

I can’t find the query string to be passed to the local HTML file method. (I copy the HTML file to isolated storage and view it from there.)

However…
I can successfully navigate to the local HTML file and specify the fragment. If the fragment contains The equal sign (=) and the ampersand (&), it can even work, so you can do this:

webBrowser1.Navigate(new Uri("index.html#123 =abc&456=def", UriKind.Relative));

And get the value in the following ways


< br />




Display the following content on the page (in the browser control).

123=abc&456=def 

(Obviously you can do more appropriate things with the value in javascript as needed.)

Yes, you can use fragent like a query string.

< p>Obviously, as long as you don’t need to use them at the same time, it will work fine.

Leave a Comment

Your email address will not be published.