Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 23rd, 2009, 04:21 PM
Authorized User
 
Join Date: Oct 2009
Posts: 17
Thanks: 7
Thanked 1 Time in 1 Post
Default How to Set DataSource in a Skin File

Hi,

If I set an ItemTemplate of a repeater in a skin file, how can I tell it where to display the relevant fields from my data source. If the ItemTemplate were being defined in a content or master page, I could simply use <$ # Eval ("FieldName") $>. But, in a skin file, data binding is not allowed?

This problem also applies to the menu control. When I wanted to define a different CSS style in each of my themes, as soon as I modified the ItemTemplate, it no longer knows where it should display the nodes of my sitemap path.

At the moment I'm looking into the programmatic options, but ideally I don't want to have to give all my controls an ID and set the values they display in code if I can do it in mark up.

Thanks for reading

Nick

  #2 (permalink)  
Old October 28th, 2009, 03:41 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You can only skin properties that have the Themable attribute applied:

http://www.dotnetattributes.com/Syst...eableAttribute
http://msdn.microsoft.com/en-us/libr...Attribute.aspx

This is not the case with the ItemTemplate property: http://msdn.microsoft.com/en-us/libr...mtemplate.aspx

Typically, UI related properties are themable, behavior related properties aren't. You can use Reflector (www.red-gate.com) to look at properties and see if they can be skinned.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parser Error in skin file Rachel BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 January 6th, 2009 10:39 PM
meta:resource key in skin file manoj.aggarwal ASP.NET 2.0 Professional 4 August 9th, 2007 08:37 AM
Object datasource VS DataSource SoftMind BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 July 27th, 2006 10:44 PM
how to add xsd file as a DataSource for the report Mojmir Reporting Services 0 March 9th, 2006 05:58 AM



All times are GMT -4. The time now is 12:35 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.