styles not loaded in datalist

Last post 09-03-2006 5:36 AM by kGenius. 4 replies.

Sort Posts:

  • styles not loaded in datalist

    08-30-2006, 4:43 AM
    • Member
      15 point Member
    • kGenius
    • Member since 06-21-2006, 12:26 PM
    • Belgium
    • Posts 5

    Hi,

    I'm new to the adapters. I get the menu-adapter working very fine.

    But as for the datalist: the adapter does its work. It generates the html needed. In the html header the css files are loaded that are in the App_Theme folder (i use the enhanced example). All files are there.
    This is the html-markup in my asp.NET page. All data is loading nice but I get no CSS loaded (unless the css provided in the skinfile via the SkinID attrib.) Do I forget something?

    <asp:DataList ID="DataList1" runat="server" SkinID="SampleDataList" DataSourceID="objTeachers" RepeatColumns=2 RepeatDirection=horizontal CssSelectorClass="PrettyDataList">
    <HeaderTemplate>Leerkrachten</HeaderTemplate>
    <FooterTemplate>&nbsp;</FooterTemplate>
    <ItemTemplate>
    <div class="Sample-Contact">
    <div class="Sample-Name"><%#Eval("Person.FirstName") & " " & Eval("Person.LastName")%></div>
    <div class="Sample-Address"><%#Eval("Grade.Name")%></div>
    </div>
    </ItemTemplate>
    </asp:DataList>

    Thanks for the help in advance.
    kGenius

    Genius is 1% inspiration and 99% perspiration
  • Re: styles not loaded in datalist

    08-30-2006, 1:38 PM
    • Contributor
      3,298 point Contributor
    • Russ Helfand
    • Member since 09-14-2005, 6:22 PM
    • Groovybits.com
    • Posts 741
    Could you post the HTML that is being rendered to the browser?  From what you described everything should work.  You said you get the proper <link> tags, including the one for DataListExample.css, presumably.  So it should contain the styles that you need.  I'm not sure why you are not seeing the rendering that you expect.  Let's start by looking carefully at the rendered HTML.
    Russ Helfand
    Groovybits.com
  • Re: styles not loaded in datalist

    09-01-2006, 9:50 AM
    • Member
      15 point Member
    • kGenius
    • Member since 06-21-2006, 12:26 PM
    • Belgium
    • Posts 5

    This is a part of the datalist rendered code:

     <div class="SampleDataList">
       
    <div class="PrettyDataList">
     <div class="AspNet-DataList">
      <table cellpadding="0" cellspacing="0" summary="">
       <thead>
        <tr>
         <th colspan="2">Leerkrachten
         </th>
        </tr>
       </thead>
       <tfoot>
        <tr>
         <td colspan="2">&nbsp;
         </td>
        </tr>
       </tfoot>
       <tbody>
        <tr>
         <td>
                    <div class="Sample-Contact">
                        <div class="Sample-Name">
                        <img id="ctl00_cphMain_DataList1_ctl01_imgTeacher" src="../altcont/image.aspx?db=personnel&amp;id=16" style='border-width:0px;' />
                            Eva Claeys
                        </div>
                        <div class="Sample-Address">
                            1ka
                        </div>
                    </div>
               
         </td>

    *¨********************************** ETC ... *************************************

     This is the link to css in header

    <link href="../App_Themes/Enhanced/DataList.css" type="text/css" rel="stylesheet" /><link href="../App_Themes/Enhanced/DataListExample.css" type="text/css" rel="stylesheet" /> etc.....

     

    Genius is 1% inspiration and 99% perspiration
  • Re: styles not loaded in datalist

    09-01-2006, 11:00 AM
    • Contributor
      3,298 point Contributor
    • Russ Helfand
    • Member since 09-14-2005, 6:22 PM
    • Groovybits.com
    • Posts 741

    Thank you for posting the markup being produced.  It did help me see (what I believe is) the problem.

    At the very start of the markup you indicated that you have this tag:

    <div class="SampleDataList">

    Since you've used SampleDataList as a class you would need rules with selectors like this:

    .SampleDataList

    However, the rules in the DataListExmaple.css file that comes with the adapter kit look like this:

    #SampleDataList

    The pound sign (as you probably know) is used when the markup uses and ID, not a CLASS.  So, you can fix this in a couple of ways:

    1. Change your markup to use <div id="SampleDataList"> or
    2. Change your CSS rules to use .SampleDataList rather than #SampleDataList.

    If these suggestions don't fix the problem, please post here again so I can continue to (try to) help.  Good luck!

    Russ Helfand
    Groovybits.com
  • Re: styles not loaded in datalist

    09-03-2006, 5:36 AM
    • Member
      15 point Member
    • kGenius
    • Member since 06-21-2006, 12:26 PM
    • Belgium
    • Posts 5

    How obvious ! Shame on me Embarrassed

    Thanks for the help.

    k(a bit)Genius

    Genius is 1% inspiration and 99% perspiration
Page 1 of 1 (5 items)
Microsoft Communities