开发者

ASP stylesheet setting

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜