c# - What's the best (easy&efficient) solution for asp.net developers to develop a mobile version of their existing website -


i hope question self-describing.

i'm developing asp.net website uses ms sqlserver database in data layer.

and thinking options mobile version (most importantly supports blackberry , iphone , every mobile device!) , when used on blackberry want able let run @ bb's background.

i thinking asp.net mobile controls projects page seems dead/not-updated framework , not sure if supports windows mobiles or what!

edit thank questions, covered problem 1 respective .. mean how going let me use blackberry appliction options letting website run @ device background or sending notifications users!

if use asp.net mvc create app , create regular , mobile views. can use jquery mobile mobile views too.

this question covers how change view based on device type,

if use webforms, can change masterpage depending on browser giving ability swap mobile versions more easily:

protected void page_preinit(object sender, eventargs e) {     if (request.browser.ismobiledevice)         masterpagefile = "~/mobile.master"; } 

or use global.asax redirect mobile requests completely:

void session_start(object sender, eventargs e) {     // redirect mobile users mobile home page     httprequest httprequest = httpcontext.current.request;     if (httprequest.browser.ismobiledevice)     {         string path = httprequest.url.pathandquery;         bool isonmobilepage = path.startswith("/mobile/",                                 stringcomparison.ordinalignorecase);         if (!isonmobilepage)         {             string redirectto = "~/mobile/";              // add special logic redirect              // recognized pages mobile equivalents of              // pages (where exist). example,             // if (httpcontext.current.handler userregistration)             //     redirectto = "~/mobile/register.aspx";              httpcontext.current.response.redirect(redirectto);         }     } } 

either way read article: http://www.asp.net/learn/whitepapers/add-mobile-pages-to-your-aspnet-web-forms-mvc-application


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -