开发者

ASP stylesheet setting

开发者 https://www.devze.com 2023-01-26 13:54 出处:网络
How can I choose one of multiple stylesheets using ASP? Heres my ASP at the moment: <% T=Request.Cookies(\"THEME\")

How can I choose one of multiple stylesheets using ASP? Heres my ASP at the moment:

<% T=Request.Cookies("THEME") %>

It's 开发者_StackOverflowin the head, there are two themes. I just need somone to show me how to do a conditional operator and if it's 1 then set a stylesheet. I could complete it from there

Thanks :)


VB Script Syntax

<% 
   IF (T = "MyTheme") THEN
%>
    ///HTML Or Style Sheet Tag Here
<%
   ELSE
%>
   ///HTML OR Style Sheet Tag Here
<%
   END IF
%>


<head>
    <%
    theme = request.cookies("theme")
    styleSheet = "<link rel=""stylesheet"" type=""text/css"" href="""
    if theme = "theme1" then
        styleSheet = styleSheet & "css/theme1.css"
    else
        styleSheet = styleSheet & "css/theme2.css"
    end if
    styleSheet = styleSheet & """ />"
    response.write(styleSheet)
    %>
</head>
0

精彩评论

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

关注公众号