0

I have a website that will need to load basic style components based on the model (determined on backend SQL server based on user input)

The concept is that this website can contained parameterized look-and-feel components which are predefined based on a landing page.

Can any one provide a basic idea or example of how to accomplish this? One idea was to store style parameters at the database, but how could a style sheet pull this. Another idea is to have these predefined style sheets corresponding to the landpage, but this would require a server control, and we wouldn't be able to implement this in the to link the style sheet.

4

1 回答 1

0

样式表无法从数据库中提取,但您当然可以创建一个处理程序来提供 CSS 文件,而不是指向物理 CSS 文件。

然而,这里更大的问题更多是业务问题。在编码之前,您必须弄清楚控件或布局到 CSS 文件的映射。如果您不这样做,我几乎可以保证,当您的系统无法满足要求时,您将在路上经历一些痛苦。如果您不想承受太多痛苦,请提前做好设计工作。

现在,回到问题。“基于登陆页面”?你的意思是不同的用户点击不同的登陆页面。如果是这样,可以将样式应用于模板(在 ASP.NET 中很容易),或者您可以创建自定义配置文件提供程序以将样式与用户结合。我会考虑这些选项。将文件存储为文件或在数据库中是一个单独的问题。

于 2011-04-26T16:01:23.273 回答