Wrox Programmer Forums

Need to download code?

View our list of code downloads.

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
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
Old May 1st, 2009, 03:57 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #3 (permalink)  
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
Reply With Quote
  #4 (permalink)  
Old May 6th, 2009, 03:06 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
eiviery (November 9th, 2009)
  #5 (permalink)  
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
Reply With Quote
  #6 (permalink)  
Old May 6th, 2009, 01:42 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #7 (permalink)  
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
Reply With Quote
  #8 (permalink)  
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
Reply With Quote
  #9 (permalink)  
Old February 24th, 2010, 06:57 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #10 (permalink)  
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:29 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.