Weird error - Literal content is not allowed within a 'skin file'

Discussion in 'ASP .Net' started by Alan Silver, Jan 26, 2006.

  1. Alan Silver

    Alan Silver Guest

    Hello,

    I am just converting a 1.1 web site to use version 2.0 of the framework
    and have run into a weird problem trying to add a skin file.

    I set up a theme, and moved the CSS file in there, no problem. I then
    changed one of the <img> tags in the master page to look like...

    <asp:Image ID="imgBsd" SkinId="imgBsd" runat="server" />

    I created a skin file in the theme folder, and added the following...

    <asp:Image SkinId="imgBsd" Imageurl="images/bsd.gif" border="0"
    width="26" height="12" AlternateText="" />

    When I try to run the page, I get the following error...

    Literal content ('<asp:Image SkinId="imgBsd" Imageurl="images/bsd.gif"
    border="0" width="26" height="12" AlternateText="" />') is not allowed
    within a 'skin file'.
    D:\WebSites\NewSite\App_Themes\Orange\Default.skin 1

    Anyone able to explain this? I have used skin files before and had
    similar content without error. I even tried copying in some content from
    a skin file on another site (that works fine), but got the same error.

    Any help appreciated. TIA

    --
    Alan Silver
    (anything added below this line is nothing to do with me)
     
    Alan Silver, Jan 26, 2006
    #1
    1. Advertising

  2. Alan Silver

    Alan Silver Guest

    >I am just converting a 1.1 web site to use version 2.0 of the framework
    >and have run into a weird problem trying to add a skin file.


    And just after posting I came across the answer... I forgot to add the
    runat="server" attribute!! Grr!! It would have been helpful if
    intellisense had worked in skin files. It seems you are completely on
    your own. You don't even get the toolbox to drag control definitions in.

    Let this be a warning to anyone who comes across the same problem!!

    --
    Alan Silver
    (anything added below this line is nothing to do with me)
     
    Alan Silver, Jan 26, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGF2ZQ==?=

    "Literal content is not allowed within a user control"?

    =?Utf-8?B?RGF2ZQ==?=, May 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,138
    =?Utf-8?B?RGF2ZQ==?=
    May 17, 2004
  2. John Smith
    Replies:
    0
    Views:
    5,030
    John Smith
    Jun 6, 2006
  3. John Smith
    Replies:
    0
    Views:
    1,357
    John Smith
    Jun 7, 2006
  4. Dave

    Literal content is not allowed within a CustomControl?

    Dave, Aug 2, 2006, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    723
  5. Ahsan Umair

    Literal content is not allowed within a UserControl

    Ahsan Umair, Jul 16, 2008, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    402
Loading...

Share This Page