<link rel="stylesheet" href="<% =cssFile %>">在代码里定义一个变量:
protected string cssFile;在Page_Load里赋值:
cssFile = "style1.css";

解决方案 »

  1.   

    http://expert.csdn.net/Expert/topic/1112/1112547.xml?temp=.8762018
      

  2.   

    可以参考微软的quickstart教程的protal个性化入口示例,把用户的样式写入数据库,再读出赋给一个通用变量如UserState["background"],在页面中如
    <body bgcolor="<%=UserState["background"]%>">就行了。方便控制又灵活。:)
      

  3.   

    <link rel="stylesheet" type="text/css" id="mystylesheet" runat="server"/>inside your code, do 
    mystylesheet.Attributes["href"] = "somefile.css";if you are using code-behind, declare in your Page class:
    protected HtmlGenericControl mystylesheet;
      

  4.   

    程序代码中用response.write("")直接写不就行了