0

I am finding certain devices are not being redirected to the .Mobile.cshtml counterpart automatically. Is there a way to fix this or force mobile based on screen resolution via HttpContext.GetOverriddenBrowser method?

4

1 に答える 1

0

Javascript の小さな部分を追加して、Javascript の Cookie を作成することもできます。

 window.screen.availHeight
 window.screen.availWidth

次に、サーバー側で _PageStart.cshtml (各ページが返される前に実行される) の Cookie を検査し、要件を満たしている場合は、

HttpContext.SetOverriddenBrowser(BrowserOverride.Mobile)
于 2012-09-28T18:07:15.120 に答える