开发者

ASP.NET Theme reference broken on pages in sub folders

I have a page that derives from a master page. The page has a them开发者_如何学编程e defined and displays properly. If I move the page to a sub folder in the web, the theme is no longer used. I see the following generated in the tag:

<link href="http://localhost:50815/MyWeb/../App_Themes/GreenBlue/StyleSheet.css" rel="stylesheet" type="text/css"/>

So the problem is the /../ Why is this being generated? How do I fix it?

One more thing, the href above is being generated by setting the page's Theme in the markup:

<%@ Page Title="" Language="C#" MasterPageFile="~/DashboardMaster.master" AutoEventWireup="true" 
CodeFile="DataSourceSetup.aspx.cs" Inherits="DataSourceSetup" Theme="GreenBlue" %>

I'm not manually adding the <link href=... It is being gnerated, and incorrectly at that.


You need to do a Page.ResolveClientUrl("~/App_Themes/GreenBlue/Stylesheet.css");

the page will then substitute the right ../ based on where you are

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜