Link to home
Start Free TrialLog in
Avatar of robossa
robossa

asked on

How to format Detailsview web control ASP.net with stylesheet css

Hello! I need to format the display of detailsview webcontrol (Asp.net) using stylesheet css and not the attributes of this control. Thnaks
Avatar of dfu23
dfu23

Give the control an ID and write some CSS specific to that ...

DetailsView ID: myDetailsView

Example CSS:

#myDetailsView {
  background-color: #eee;
  border: 3px solid #000;
  color: #00f;
  font-family: Courier;
}

Is that the kind of thing that you are looking for?
Avatar of robossa

ASKER

Thnaks. It is not working. To be more especific, I want to "translate" the format properties of the detailsview web control such as the followings in a stylesheet css. How will you do that, since the sample you wrote does not work.

<asp:DetailsView ID="_detailsView" runat="server"                
                          AutoGenerateRows="false" DataKeyNames="BusinessListingID"                            
                          DataSourceID="EditDataSource"                                                        
                          EmptyDataText="No Data"
                          AlternatingRowStyle-BackColor = "#abbde3"                   
                                Width="400"
                                OnDataBound="_detailsView_DataBound"                     
                                Headertext="Business or Ranch Information"
                                HeaderStyle-BackColor="#000066"
                                HeaderStyle-ForeColor="#ffffff"
                                Showheader="true"
                                CssSelectorClass="datailsview"
                                >
ASKER CERTIFIED SOLUTION
Avatar of dfu23
dfu23

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial