2010-05-06 56 views
0

在下面的代碼中,我嘗試將Dijit主題應用於.aspx頁面中的控件。然而,這些控制仍然存在於他們正常的,毫無保留的外觀之中。在ASP.NET頁面中應用Dojo Toolkit(Dijit)主題

有人知道爲什麼嗎?

母版頁:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="WebJournalEntryClient.Main" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
    <title>My Web Application</title> 
    <link rel="stylesheet" href="dojoroot/dijit/themes/tundra/tundra.css" /> 
    <script type="text/javascript" src="dojoroot/dojo/dojo.js"/> 
    <script type="text/javascript"> 
     dojo.require("dijit.form.Button"); 
     dojo.require("dijit.form.TextBox"); 
     dojo.require("dijit.form.ComboBox"); 
    </script> 
</head> 
<body class = "tundra"> 
    <form id="form1" runat="server"> 
    <div> 
     <div> 
      This is potentially space for a header bar. 
     </div> 
     <table> 
     <tr> 
      <td> 
       Maybe <br /> a <br /> Side <br /> bar. 
      </td> 
      <td> 
       <asp:ContentPlaceHolder ID="CenterPlaceHolder" runat="server"/> 
      </td> 
     </tr> 
     </table> 
     <div> 
      This is potentially space for a footer bar. 
     </div> 
    </div> 
    </form> 
</body> 
</html> 

內容頁:

<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"  CodeBehind="LogIn.aspx.cs" Inherits="WebJournalEntryClient.LogIn" %> 
<asp:Content ID="Content" ContentPlaceHolderID="CenterPlaceHolder" runat="server"> 
    <div> 
    User ID: <asp:TextBox ID = "UserName" dojoType="dijit.form.TextBox" runat="server" /><br /> 
    Password: <asp:TextBox ID = "PassWord" dojoType="dijit.form.TextBox" runat="server" /><br /> 
    <asp:Button ID="LogInButton" Text="Log In" dojoType="dijit.form.Button" runat="server" /> 
    </div> 
</asp:Content> 

回答

0

可能是路徑是錯誤的。使用Firebug來查看它是否正在讀取任何css。

+0

瀏覽器絕對是下載tundra.css – mcoolbeth 2010-05-11 14:24:34

0

我不確定ASP.net是如何處理你的頁面的。 然而,無論如何,你可以仔細檢查與螢火蟲wheather你的身體有「苔原」類在瀏覽器輸出?我假設CSS正在合適(:正如您在上述評論中提到的)

2

您需要將djConfig="parseOnLoad: true"添加到您的腳本標記中。

<script type="text/javascript" src="dojoroot/dojo/dojo.js" djConfig="parseOnLoad: true"/> 

或者

dojo.parser.parse();