View Single Post
Old March 27th, 2013, 04:09 PM
grandma grandma is offline
Authorized User
Points: 56, Level: 1
Points: 56, Level: 1 Points: 56, Level: 1 Points: 56, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jan 2013
Location: Topeka, KS
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Default GridView css not working

My question has to do with Beginning ASP.NET 3.5 in C# and VB. however when I post in that forum, my question simply disappears after a few hours. I have addressed this problem to tech support and got no answer, so I am trying this.

In chapter 14 the GridView on the Genre page does not respond to the css formatting. I cannot see where the error is.

Here is my markup for the Genres page:

<%@ Page Language="VB" MasterPageFile="~/MasterPages/ManagementMaster.master" AutoEventWireup="false" CodeFile="Genres.aspx.vb" Inherits="Management_Genres" title="Planet Wrox - Management - Genres" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataKeyNames="Id" DataSourceID="SqlDataSource1" 
    EmptyDataText="There are no data records to display." AllowPaging="True" 
        AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None">
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
            ShowSelectButton="False" ItemStyle-Width="100px" />
        <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" ItemStyle-Width="200px" />
        <asp:BoundField DataField="SortOrder" HeaderText="SortOrder" 
            SortExpression="SortOrder" />
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataKeyNames="Id" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
            Height="50px" Width="125px">
                <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="Id" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="SortOrder" HeaderText="SortOrder" 
                    SortExpression="SortOrder" />
                <asp:CommandField ShowInsertButton="True" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:PlanetWroxConnectionString1 %>" 
    DeleteCommand="DELETE FROM [Genre] WHERE [Id] = @Id" 
    InsertCommand="INSERT INTO [Genre] ([Name], [SortOrder]) VALUES (@Name, @SortOrder)" 
    ProviderName="<%$ ConnectionStrings:PlanetWroxConnectionString1.ProviderName %>" 
    SelectCommand="SELECT [Id], [Name], [SortOrder] FROM [Genre]" 
    UpdateCommand="UPDATE [Genre] SET [Name] = @Name, [SortOrder] = @SortOrder WHERE [Id] = @Id">
        <asp:Parameter Name="Id" Type="Int32" />
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="SortOrder" Type="Int32" />
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="SortOrder" Type="Int32" />
        <asp:Parameter Name="Id" Type="Int32" />
Here is the Management.css:

	font-family: Verdana, Arial, Sans-Serif;

	font-size: 80%;

.GridView, .GridView a
	color: #000;

.GridViewHeaderStyle, .GridViewPagerStyle, .GridViewEditRowStyle
	background-color: #bee4cf;

	background-color: #e1e1e1;

	text-align: left;

.GridViewHeaderStyle a
	text-decoration: none;
and here is

<asp:GridView runat="server" CssClass="GridView">
    <PagerStyle CssClass="GridViewPagerStyle" />
    <HeaderStyle CssClass="GridViewHeaderStyle" />
    <EditRowStyle CssClass="GridViewEditRowStyle" />
    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle"/>  
I am getting a warning about "no build provider registered for the extension 'skin'" I realize that is not a fatal error, but I don't recall seeing it when I worked with other skin files in this book.

And yes I did set the pages theme="Management" in the web.config file.