Databinding in Skins causes trouble in VS 2005


S

Sebastian

Hi,

I want to skin the templates of an asp:DataList. So I have to do data
binding in the skin (I didn't find another comfortable way to do
that). As soon there's a <%# ... %> tag in the skin, VS seems not to
recognize the skin file anymore. The property editor displays SkinID
grayed out, and I cannot select anything.
Interestingly, I can enter the SkinID by hand, and page rendering
actually works!

Of course, separation of code and layout is lost when doing
databinding in the skin. I'd like to avoid that, but how can I skin
the DataList's templates and do databinding directly on the control?
As soon as my DataList skin contains an ItemTemplate, any databinding
is lost.

Btw.: Is it normal that VS does not apply the skin in the designer? I
have to open the page in a browser to see the results. Forther more,
inellisense does not work in skin files.

Kind regards, Sebastian
 
Ad

Advertisements

G

Guest

Hi Sebastian,

I don't think you can use binding expression for SkinID because this
property can only be set in PreRender event or (your case) before control is
added to the tree (databinding takes place after template is fully created).
 
S

Sebastian Paul

Hi,

I just want to add that VS only shows the skin if it has been set up
as "StyleSheetTheme". Before, I set up a "Theme", what seems to have a
quite other meaning. As I understood, StyleSheetTheme is applied very
early in the processing pipeline, while Theme applies later and may
override the StyleSheetTheme.

Intellisense works in Skin files, if you map a certain editor to the
file extension. This can be done in Tools->Options->Text-Editor->File
Extension. Just add "User Control Editor" for the "skin" extension.
VS sometimes worries that there's no build provider for that
extension, but this has no effect.

Kind regards, Sebastian
 
Ad

Advertisements


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

Top