Saturday, 20 February 2010

Browser-Specific Master Pages

When you are trying to create a master page for your website, you may just wonder how can you make them that every user with any browser can call your pages up. No matter they are using IE or Firefox or even Opera on their tiny PocketPC.

You can easily design different pages for different container. How? By adding an attribute into master page property.

<%@ Page language="C#" MasterPageFile="~/Test.master"
      Mozilla:MasterPageFile="~/TestMozilla.master"
      Opera:MasterPageFile="~/TestOpera.master" %>
....

You can find a list of available browsers on the production server where the application will be hosted at C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\

  • avantgo
  • cassio
  • Default
  • docomo
  • ericsson
  • EZWap
  • gateway
  • generic
  • goAmerica
  • ie
  • Jataayu
  • jphone
  • legend
  • MME
  • mozilla
  • netscape
  • nokia
  • openwave
  • opera
  • palm
  • panasonic
  • pie
  • webtv
  • winwap
  • xiino
     


3 comments:

  1. Oh Ehsan greate blog and great posts, keep it guy (ata)

    ReplyDelete
  2. Hi,

    Congratulations! Keep going, and I think your posts need a little more detail explanation. I mean you may provide a little in depth description of your code.

    Although I don't like .NET, I will follow your blog.

    Good luck

    ReplyDelete
  3. @Ata:
    Thanks so much for setting up my new website…

    @Behrang:
    Thanks Behrang for your comment.. I do agree with you. I'll keep it in my mind... See you

    ReplyDelete