2008年3月25日 星期二

Step-By-Step教學(2):在不同的瀏覽器顯示不同的ASP.NET主版頁面

ASP.NET的主版頁面功能,在設計上,可以視需求針對不同的瀏覽器顯示不同的主版頁面(Master Page),做法相當簡單,參考以下步驟。
  1. 在ASP.NET 3.5網站,建兩個Master Page,分別為 SystexIE.master與SystexFirefox.master。
  2. SystexIE.master畫面看起來如:
  3. SystexFirefox.master畫面看起來如:
  4. 加一個DeviceSpecMaster.aspx網頁,選SystexIE.master,然後修改Page宣告為

    <@ Page Language="C#"
    ie:MasterPageFile="~/SystexIE.master"
    Mozilla:MasterPageFile="~/SystexFirefox.master" %>

  5. 在IE中執行看起來的樣子如:


    在Firefox中執行看起來的樣子如:

沒有留言:

總網頁瀏覽量