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

A

Alan Silver

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
 
A

Alan Silver

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!!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top