Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
 
Old April 30th, 2009, 04:48 PM
Registered User
 
Join Date: Apr 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 14: Pages 491-492: Part of row doesn't show the black background

Imar:
I'm back with a new question. This pertains to the Try it Out on Pages 491 to 492.
When I first typed in the code, I could not get the CSS to show when I found a review with a “NO” Authorized on the Reviews.aspx. I reviewed the source code from Chp 14, even copied and pasted it over my pages and still no markup was showing.

Finally, I linked the Management.css to the ManagementMaster.master file. I got
part of the row to show the CSS. Now the white text is showing up on the row, but 2 of the columns in the row don’t show the black background. The two Columns that show the black background are the Title and Delete Columns. The Authorized and CreateDateTime Columns for that row have the white text but the black background does not show. It shows the Classic format for the Gridview control.


Any suggestions?

I really love this book
gfmann
 
Old May 1st, 2009, 03:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Good to hear you like the book.

How does the CSS class look for the columns? Like this:

Code:
.HighContrast, .HighContrast a { background-color: Black; color: White;
}
Notice how there are two selectors here: one class selector for HighContrast and one for all a elements inside the HighContrast class. Is the spelling and capitalization the same as shown above?


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!
 
Old May 5th, 2009, 05:30 PM
Registered User
 
Join Date: Apr 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Red face Response about what CSS class looks like for the columns

Imar:
Yes. That's the code I have in the Management.css file.
Sorry for taking so long to get back with you.
v/r,
gfmann
 
Old May 6th, 2009, 03:06 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can you show me the final HTML for the page?

Are you sure it's not a caching issue where the browser is using an old version of the CSS file? (press Ctrl+F5 in the browser to reload).

Otherwsise, can you post the relevant code for the pages?

Cheers,

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:
eiviery (November 9th, 2009)
 
Old May 6th, 2009, 10:05 AM
Registered User
 
Join Date: Apr 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Chapter 14:Pages 491-492

Imar:
It was a caching problem. Works now.
Thank you.
Again, "Two heads are better than one..." to work on a problem.
gfmann
 
Old May 6th, 2009, 01:42 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Absolutely!

Glad it's working now...

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!
 
Old November 9th, 2009, 04:22 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hi,

Just wanted to say that I just had this exact issue. Caching turned out to be the culprit also. Thanks for asking gfmann!


Chuck
 
Old February 24th, 2010, 06:11 PM
Registered User
 
Join Date: Feb 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I cannot get the unauthorized Reviews to use the black background either.

I have followed the code exactly. Every Try It Out has worked for me up until now. I tried linking the ManagementMaster.master to the Management.css file using the following code:

Quote:
<link href="../App_Themes/Management/Management.css" rel="stylesheet" type="text/css" />
I tried refreshing the page, deleting all of my cookies and temporary internet files and it still doesn't work.

Anything else I can try?

Thanks,
Yaron
 
Old February 24th, 2010, 06:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Is it related to the code in the Code Behind or to the CSS? What happens when you debug the code, or make another change in the CSS file? Do you see those changes appear somewhere?

If that doesn't help, can you post more details and the relevant code of the markup, Code Behind and CSS sections?

Cheers,

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!
 
Old February 25th, 2010, 11:49 AM
Registered User
 
Join Date: Feb 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I tried adding "font-size: xx-large" to the CSS file. No luck there.

I know that the case statement executes because I put a stop in the code at that point. It executes twice. Once for each unauthorized Review. Additionally, I added a label to the bottom of the page that prints the CssClass property of each row item that is unauthorized. It prints "HighContrast" twice as expected for the Indie Rock category.

Here is the GridView markup, including the additional label I added (Reviews.aspx):
Quote:
<asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="Id">
<asp:ListItem Value="">Please make a selection</asp:ListItem>
</asp:DropDownList>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
DataSourceID="SqlDataSource2" onrowdatabound="GridView1_RowDataBound">
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="Id"
DataNavigateUrlFormatString="AddEditReview.aspx?Id ={0}" DataTextField="Title"
HeaderText="Title" />
<asp:TemplateField HeaderText="Authorized" SortExpression="Authorized">
<ItemTemplate>
<asp:Label ID="lblAuthorized" runat="server" Text='<%# GetBooleanText(Eval("Authorized")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CreateDateTime" HeaderText="CreateDateTime"
SortExpression="CreateDateTime" DataFormatString="{0:g}" />
<asp:CommandField HeaderText="Delete" ShowDeleteButton="True" />
</Columns>
</asp:GridView>
<a href="AddEditReview.aspx">Insert New Review</a><br />
<asp:Label ID="Label1" runat="server" ></asp:Label>
Here is the Code Behind source (Reviews.aspx.cs):
Quote:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
switch (e.Row.RowType)
{
case DataControlRowType.DataRow:
DataRowView myDataRowView = (DataRowView)e.Row.DataItem;
if (!Convert.ToBoolean(myDataRowView["Authorized"]))
{
e.Row.CssClass = "HighContrast";
Label1.Text += e.Row.CssClass.ToString() + "<br />";
}
break;
}
}
Here is the CSS class (Management.css):
Quote:
.HighContrast .HighContrast a
{
background-color: Black;
color:White;
font-size: xx-large;
}
Thanks for the help,
Yaron





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 14 page 491 Will BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 April 25th, 2009 04:52 AM
Background image in a web part? meichmann1967 BOOK: Beginning SharePoint 2007: Building Team Solutions with MOSS 2007 ISBN: 978-0-470-12449-9 0 October 15th, 2007 12:55 PM
Chapter 11: XNA Shooter - black screen IanBrooks BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 3 August 4th, 2007 08:32 AM
Float causing background-color not to show wheelie CSS Cascading Style Sheets 3 January 24th, 2006 07:29 AM
Errors in Code; Chapter 14, pages 566-567 ou812 BOOK: Beginning ASP 3.0 10 June 20th, 2004 09:43 AM





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