views:

398

answers:

1

I have a simple WPF application with a webbrowser control. When I direct the control to load a page I'd like to have the control tell the server it's trying to load the page from that it's a mobile device and therefore load the smaller version of the page. I know a lot of sites just add mobile before the address, so google.com's mobile page is just mobile.google.com, but I'm wondering if there is a way to load the have the web server automatically direct my webbrowser control to the mobile version of the site? I feel like there should be a very simple way to do this, but I just can't figure it out :).

Thanks in advance!!!

+1  A: 

This will generally be controlled by the site using the User Agent, which is not something you can change with the standard WebBrowser control. There is an alternative WPF webbrowser control, based on Chromium, which you can download from CodePlex. It might not support User Agent spoofing out of the box, but it's open source so you can manually change it in the code to an iPhone, Windows Mobile etc.

Steven Robbins
Very clear answer. I was going to say you need to set the user agent to a phone based UA, however I was unaware that you couldn't easily change the UA.
Chris Marisic
Thanks for your reply! I'll try Chromium.
Evan