Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 27th, 2013, 04:09 PM
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:

Code:
<%@ 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>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <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">
        
    <Columns>
        <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" />
    </Columns>
  
</asp:GridView>
        &nbsp;
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataKeyNames="Id" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
            Height="50px" Width="125px">
            <Fields>
                <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" />
            </Fields>
        </asp:DetailsView>
<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">
    <DeleteParameters>
        <asp:Parameter Name="Id" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="SortOrder" Type="Int32" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="SortOrder" Type="Int32" />
        <asp:Parameter Name="Id" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
</ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
Here is the Management.css:

Code:
*
{
	font-family: Verdana, Arial, Sans-Serif;
}

body
{
	font-size: 80%;
}

.GridView, .GridView a
{
	color: #000;
}

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

.GridViewAlternatingRowStyle
{
	background-color: #e1e1e1;
}

.GridViewHeaderStyle
{
	text-align: left;
}

.GridViewHeaderStyle a
{
	text-decoration: none;
}
and here is GridView.skin:

Code:
<asp:GridView runat="server" CssClass="GridView">
    <PagerStyle CssClass="GridViewPagerStyle" />
    <HeaderStyle CssClass="GridViewHeaderStyle" />
    <EditRowStyle CssClass="GridViewEditRowStyle" />
    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle"/>  
</asp:GridView>
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.
  #2 (permalink)  
Old March 27th, 2013, 04:46 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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

Did you do that in the web.config for the Management section?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
grandma (March 27th, 2013)
  #3 (permalink)  
Old March 27th, 2013, 04:58 PM
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

That was it. Thank you!
  #4 (permalink)  
Old October 5th, 2013, 09:35 PM
Authorized User
Points: 101, Level: 2
Points: 101, Level: 2 Points: 101, Level: 2 Points: 101, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2013
Location: saudi arabia
Posts: 25
Thanks: 6
Thanked 0 Times in 0 Posts
Default YES !!!

That was exactly what I was going to ask about
and the answer worked very well
thaaaaaaaaaaaaaanx


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS not working when deploying mpgrahn BOOK: Beginning ASP.NET 4 : in C# and VB 9 June 12th, 2012 04:24 PM
Customize column in CSS friendly GridView Frankster BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2 2 April 14th, 2010 10:04 AM
CSS not working with RAD Rhani CSS Cascading Style Sheets 0 April 3rd, 2007 02:40 PM
CSS Code is not working dyrer BOOK: Professional CSS: Cascading Style Sheets for Web Design 0 January 16th, 2006 06:34 PM
CSS Scroll bar in IE not working BobbyFisher CSS Cascading Style Sheets 2 April 18th, 2005 05:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.