Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. This is weird! [modified]

This is weird! [modified]

Scheduled Pinned Locked Moved ASP.NET
helpcsharpcssasp-netcom
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Waleed Eissa
    wrote on last edited by
    #1

    I'm creating a multilingual website so I'm trying to dynamically include the language related stylesheet. As you might have already expected, I do this in the page head using a link tag. Well, for some reason I'm not aware of, the code below doesn't work (when I move it outside the the page head, it works though!): It gives this output: On the other hand this code works perfectly: <link rel="stylesheet" href=<%= string.Format("\"/css/{0}\"", _language.Stylesheet) %> type="text/css" media="screen" /> This is really weird, can anybody explain what's going on?!! P.S. This is ASP.NET 2.0 UPDATE When tried to remove runat="server" from the head tag, it actually worked! The problem is that I set the page title in my code so I have to keep runat="server" in the head tag, it seems like a bug to me, what do you think?

    Waleed Eissa Software Developer Sydney

    modified on Thursday, June 26, 2008 6:36 AM

    C N 2 Replies Last reply
    0
    • W Waleed Eissa

      I'm creating a multilingual website so I'm trying to dynamically include the language related stylesheet. As you might have already expected, I do this in the page head using a link tag. Well, for some reason I'm not aware of, the code below doesn't work (when I move it outside the the page head, it works though!): It gives this output: On the other hand this code works perfectly: <link rel="stylesheet" href=<%= string.Format("\"/css/{0}\"", _language.Stylesheet) %> type="text/css" media="screen" /> This is really weird, can anybody explain what's going on?!! P.S. This is ASP.NET 2.0 UPDATE When tried to remove runat="server" from the head tag, it actually worked! The problem is that I set the page title in my code so I have to keep runat="server" in the head tag, it seems like a bug to me, what do you think?

      Waleed Eissa Software Developer Sydney

      modified on Thursday, June 26, 2008 6:36 AM

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The problem is one is <% and the other is <%=

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      W 1 Reply Last reply
      0
      • C Christian Graus

        The problem is one is <% and the other is <%=

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        W Offline
        W Offline
        Waleed Eissa
        wrote on last edited by
        #3

        Thanks for noticing this (I modified the post after reading your post), but actually this is not the problem, it still give the same output!

        Waleed Eissa Software Developer Sydney

        1 Reply Last reply
        0
        • W Waleed Eissa

          I'm creating a multilingual website so I'm trying to dynamically include the language related stylesheet. As you might have already expected, I do this in the page head using a link tag. Well, for some reason I'm not aware of, the code below doesn't work (when I move it outside the the page head, it works though!): It gives this output: On the other hand this code works perfectly: <link rel="stylesheet" href=<%= string.Format("\"/css/{0}\"", _language.Stylesheet) %> type="text/css" media="screen" /> This is really weird, can anybody explain what's going on?!! P.S. This is ASP.NET 2.0 UPDATE When tried to remove runat="server" from the head tag, it actually worked! The problem is that I set the page title in my code so I have to keep runat="server" in the head tag, it seems like a bug to me, what do you think?

          Waleed Eissa Software Developer Sydney

          modified on Thursday, June 26, 2008 6:36 AM

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          I haven't had such an issue. you can add stylesheets from code behind page. Try that instead of doing this.

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

          W 1 Reply Last reply
          0
          • N N a v a n e e t h

            I haven't had such an issue. you can add stylesheets from code behind page. Try that instead of doing this.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

            W Offline
            W Offline
            Waleed Eissa
            wrote on last edited by
            #5

            Thanks for your reply but actually the problem is already solved (read the post till the end), I just wanted to understand what was going on Regards

            Waleed Eissa Software Developer Sydney

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups