مروری مقدماتی بر ساخت برنامههای موبایل در MVC4
نویسنده: وحید م
تاریخ: ۱۳۹۲/۰۶/۱۵ ۲۳:۱۵
آدرس: www.dntips.ir
| مطالب | ۳۶۹۴ |
| نویسندگان | ۲۷۶ |
| گروههای مطالب | ۱۰۲۴ |
| نقشههای راه | ۱۱۹ |
| دورهها | ۱۴ |
| اشتراکها | ۱۷۹۱۴ |
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
AuthConfig.RegisterAuth();
InitializeDisplayModeProvider();
}
protected void InitializeDisplayModeProvider()
{
var phone = new DefaultDisplayMode("Phone")
{
ContextCondition = ctx => ctx.GetOverriddenUserAgent() != null &&
ctx.GetOverriddenUserAgent().Contains("iPhone")
};
var mobile = new DefaultDisplayMode("Tablet")
{
ContextCondition = ctx => ctx.GetOverriddenUserAgent() != null &&
ctx.GetOverriddenUserAgent().Contains("iPad")
};
DisplayModeProvider.Instance.Modes.Insert(0, phone);
DisplayModeProvider.Instance.Modes.Insert(1, mobile);
}