Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 208761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:51:17+00:00 2026-05-11T17:51:17+00:00

I have a control that look something like this: <asp:DetailsView ID=dvUsers runat=server DataSourceID=odsData DataKeyNames=Id>

  • 0

I have a control that look something like this:

<asp:DetailsView ID="dvUsers" runat="server" DataSourceID="odsData" 
                 DataKeyNames="Id">
...
</asp:DetailsView>

Which in the end will create a <table> as the outer-most element. In my CSS I have:

table tr {
border-top: 0 ;
border-left: 0 ;
border-right: 0 ;
border-bottom-width: 1px;
}

Now when I run the web-site the rendered <table> will have borders and styles which is due to the default settings for the control, which looks like this

<table cellspacing="0" rules="all" border="1" id="ctl00_body_dvUsers" 
       style="border-collapse:collapse;"> 

This will obviously override my CSS since it is inline and I do not want this. Is there any way of turning of all of the styling that is automatically done? I guess that I could receive the same result as my CSS by setting a lot of attributes on the DetailsView,
but I might have a lot of controls which in the end would render the final output as a table and I would have to configure all of these the same way.

This would result in a lot of duplicate code and a lot of work if some designer want to change the style of all the tables, since I would have to go back and change the styles for every control in my Theme file.

Is there a way of saying “Don´t mess with the styles, I know what I am doing!” ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:51:17+00:00Added an answer on May 11, 2026 at 5:51 pm

    Take a look at the CSS Friendly Control Adapters project. It provides a drop-in solution to convert the DetailsView control (and others) from a table-based design a to div-based design that uses CSS classes instead of inline styles.

    So, for example, it automagically turns this headache-inducing code:

    <table cellspacing="2" CssSelectorClass="PrettyDetailsView" border="0" id="ctl00_ctl00_MainContent_LiveExample_DetailsView1" style="background-color:White;border-style:None;">
      <tr style="color:#F7F6F3;background-color:#5D7B9D;font-weight:bold;">
        <td colspan="2">Author Details</td>
      </tr><tr style="color:#333333;background-color:White;">
        <td style="font-weight:bold;">ID</td><td>998-72-3567</td>
      </tr><tr style="color:#333333;background-color:#F7F6F3;">
        <td style="font-weight:bold;">Last name</td><td>Ringer</td>
      </tr><tr align="center" style="color:Cyan;background-color:#284775;">
        <td colspan="2"><table border="0">
          <tr>
            <td><span>1</span></td><td><a href="javascript:__doPostBack('ctl00$ctl00$MainContent$LiveExample$DetailsView1','Page$2')" style="color:Cyan;">2</a></td>
          </tr>
        </table></td>
      </tr>
    </table>
    

    into peace and serenity:

    <div class="PrettyDetailsView" id="ctl00_ctl00_MainContent_LiveExample_DetailsView1">
      <div class="AspNet-DetailsView">
          <div class="AspNet-DetailsView-Header">
            Author Details
          </div>
          <div class="AspNet-DetailsView-Data">
            <ul>
              <li>
                <span class="AspNet-DetailsView-Name">ID</span><span class="AspNet-DetailsView-Value">998-72-3567</span>
              </li>
              <li class="AspNet-DetailsView-Alternate">
                <span class="AspNet-DetailsView-Name">Last name</span><span class="AspNet-DetailsView-Value">Ringer</span>
              </li>
            </ul>
          </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>
    

    I’ve been using it successfully for a while now, highly recommend it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 96k
  • Answers 96k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Slicing creates a shallow copy. In your example, I see… May 11, 2026 at 7:07 pm
  • Editorial Team
    Editorial Team added an answer We encountered this issue as well, though it only happened… May 11, 2026 at 7:07 pm
  • Editorial Team
    Editorial Team added an answer Give jQuery a try. Then you can simply do this:… May 11, 2026 at 7:07 pm

Related Questions

I have a composite control that has a large number of properties that can
I need a dropdown list on my page that will allow a user to
Lets say I have a custom data type that looks something like this: public
I am trying to add a template to a simplified composite control containing a
I'm building a heavily CRUD based ASP.NET website and I've got to the phase

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.