locked
Very cool! RRS feed

  • Question

  • User1907152121 posted

    Before this whole thing gets set in stone, you should consider using DL, DT and DD for the FormView and DetailsView adapters. This would enable a much better match to the styling rules, not requiring two entirely different CSS classes for the "label" and field "values".  Instead, you map DT to the overall view, then DT for the label and DD for the field value.  These tags have been around since HTML 2.0, so they are well supported.  I'm using this pattern (with much fewer classes required):

    <div class="PrettyDetailsView">
      <div class="AspNet-DetailsView">
        <div class="AspNet-DetailsView-Header">
          Author Details
        </div>
        <dl>
            <dt>ID</dt><dd>998-72-3567</dd>
            <dt class="AspNet-DetailsView-Even">Last name</dt><dd class="AspNet-DetailsView-Even">Ringer</dd>
        </dl>
        <div class="AspNet-DetailsView-Footer">      
        </div>
        <div class="AspNet-DetailsView-Pagination">
          <span class="AspNet-DetailsView-ActivePage">1</span><a class="AspNet-DetailsView-OtherPage" href="javascript:__doPostBack('ctl00$ctl00$MainContent$LiveExample$DetailsView1','Page$2')">2</a>
        </div>
      </div>
    </div>
    This is obviously much simpler in the body-portion, I've already modified my Adapter, but others might want a similar experience.
    Sunday, April 30, 2006 12:18 AM

All replies

  • User-534056067 posted

    In situations where you have more than one value per record (i.e., you end up with more than one dd per dt, I found I couldn't create CSS that would cause the dt and all its dd tags to render on the same horizontal line in the browser.  Can you suggest how you would create CSS rules that would handle this?

    Generally, I like the dl, dt, dd solution in simple cases where you have just one value per record (plus its title) but the multi-value case is a problem.

    Remember that, unlike the native rendering of dl/dt/dd, the DetailsView wants to put each record on the same line, not stacked vertically with the dt above its dd value (which is what appears if you don't style them at all).

    Thoughts?

    -Russ-

    Monday, May 1, 2006 9:23 AM
  • User1907152121 posted

    Just float:left the dd's in css

     

    <html>
    <head>
    <style>
    .Odd
    {
    background:red;
    }

    .Even
    {
    background:green;
    }

    .AspNet-DetailsView dt
    {
    clear:left;
    }

    .AspNet-DetailsView dd
    {
    float:left;
    }
    .AspNet-DetailsView dd
    {
    float:left;
    }
    </style>
    </head>
    <body>
    <div class="PrettyDetailsView">
      <div class="AspNet-DetailsView">
        <div class="AspNet-DetailsView-Header">
          Author Details
        </div>
        <dl>
            <dt class="Odd">ID</dt>
                <dd class="Odd">998-72-3567</dd>
            <dt class="Even">Last name</dt>
                <dd class="Even">Ringer</dd>
                <dd class="Even">Dinger</dd>
        </dl>
        <div class="AspNet-DetailsView-Footer">     
        </div>
        <div class="AspNet-DetailsView-Pagination">
          <span class="AspNet-DetailsView-ActivePage">1</span><a class="AspNet-DetailsView-OtherPage" href="#2">2</a>
        </div>
      </div>
    </div>
    </body>
    </html>

    Monday, May 1, 2006 9:03 PM
  • User-1138738125 posted

    just remmeber to put a <div stly="clear:both;"></div> directly afher the place where you call your control

    <div>

    call control here

    <div stly="clear:both;"></div>

    </div>

     

     

    Tuesday, May 2, 2006 6:47 AM
  • User-2031965490 posted
    IDisposable: one point of this kit was for peopel to build even more adapters for lots of different purposes -- why don't you share the code for your <dl><dt><dd> implementation?  I'm sure people would love it and then there would be more choice out there.

    Laurent posted about a great mod for doing selections on the menu control, there is a lot of potential to grow an amazing set of community built adapters.

    Just my take :) and my goal for this whole project.

    Thanks,
    Brian

    Tuesday, May 2, 2006 9:43 PM
  • User608021913 posted

     I want to use that tags into my web pages.. you should share your code??

     Regards

     Diego G.

    Sunday, May 10, 2009 8:45 PM