ASP.NET主题不正确渲染 [英] ASP.NET theme not rendering correctly

查看:110
本文介绍了ASP.NET主题不正确渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用的主题小型Web应用程序。主题在主机工作,所以对preINIT,如果主机=一,负荷×主题,如果主机= B,负载ÿ主题。

I have a small web application which uses themes. The themes work on host, so on preinit, if the host = a, load x theme, if the host = b, load y theme.

在我的code,这看起来像:

In my code this looks like:

如果request.url.host.contains(一)。然后
Page.Theme = X
其他
request.url.host.contains(B)。然后
Page.Theme = Y

If request.url.host.contains("a") Then Page.Theme = x Else request.url.host.contains("b") Then Page.Theme = y

我有一个URL是a.abc.com和另一个是b.abc.com(以及它是这样的结构,但字母是有意义/公司名称)。问题是(我做了主持人==),当我调试我在本地主机上的网站(在上面的一个条款,如果块其中host =本地主机),风格完美呈现。元件排列是完美的,我期待着与我已经提供了宽度,利润等在CSS的数值。但是当我使用VS2008的发布工具(具有可更新打勾),并上传到a.abc.com,具有相同的样式表为localhost(在自己的文件夹的副本),有各种各样的对齐问题,如果我没有做过的工作。为什么我的风格不正确渲染@运行?如果有帮助,我使用VS2008专业版,IIS6和Windows Server 2003。

I have a url which is a.abc.com and another which is b.abc.com (well it is this structure, but the letters are meaningful/company names). Problem is (and I have done host == ""), when I debug my site on localhost (another clause in the above if block where host = localhost), the style renders perfectly. Alignment of elements are perfect as I expect with the numerical values I have provided for width, margins, etc in the css. But when I use the publish tool of VS2008 (with updatable ticked), and upload to a.abc.com, which has the same stylesheet as localhost (a copy in its own folder), there are all sorts of alignment issues as if I have done no work. Why do my styles render incorrectly @ runtime? If it helps, I am using VS2008 Pro Edition, IIS6 and Windows Server 2003.

什么是令人沮丧的是,网页的源文件指示主题加载行,因为它是在HTML头引用。所以,当我发布,为a.abc.com主题加载和参考。除了所有这些信息,有一个问题是没有什么明显的标志。我没有试图引用传统的ASPX标记一个CSS文件,但如果我没有和这个工作,那么它没有任何解释的问题,无论如何。

What is frustrating is that the page source indicates the theme is loading ok, as it is referenced in HTML head. So when I publish, the theme for a.abc.com is loaded and referenced. Other than all this information, there is no obvious sign of what the problem is. I haven't tried to conventionally reference a single CSS file in the ASPX markup, but if I did and this worked, then it doesn't explain the problem either, anyway.

感谢

推荐答案

最近,我遇到了这个问题,写的一个快速的博客中介绍了如何围绕它得到。万一别人是有这个问题,你只需要授权主题文件夹中你的web.config。

I encountered this problem recently and wrote a quick blog that explains how to get around it. Just in case someone else is having this problem, you just need to authorize the Theme folder in your web.config.

这篇关于ASP.NET主题不正确渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆