Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : 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
 
Old October 23rd, 2012, 12:15 PM
Authorized User
 
Join Date: Oct 2012
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Default Chapter 15 - Try it out - p. 537 (java script)

My result is different from the previous post in this area. When I bring up Genres.aspx I see the up and down arrows but not the alternating stripes. When I use IP for the browser I receive an error message that the function $ is undefined (from the jQuery code). The error message is SCRIPT5009. When I use Chrome as the browser there is no error message but still no alternating stripes. Any ideas as to the source of this problem?

A related question: In the management.css file there is an entry for:
.GridView, .GridView a
{...}
Wouldn't just plain .GridView accomplish the same result since .GridView a is a subset of .GridView
 
Old October 24th, 2012, 06:43 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, but the a element is styled elsewhere as well. By specifically targeting a elements within the GridView, it gets a higher "specificity" which in turn ensures it overwrites whatever was set on the a element earlier with a lower specificity.

Hope this helps,

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 October 25th, 2012, 03:56 PM
Authorized User
 
Join Date: Oct 2012
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Default Superfluous?

Imar,
I understand the specificity of .Gridview a. But since .Gridview and .Gridview a are on the same line, they are applying the same formatting. It looks to me as though .Gridview a is superfluous.
Nick1248
P.S. Any thoughts as to why $ is not understood by the browsers?
 
Old October 25th, 2012, 09:23 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

.GridView addresses whatever is inside the GridView. This determines the color of the regular text. .GridView a then addresses links specifically.

In the current setup, the text is already black. However, by explicitly stating all text in the GridView should be black, you can overwrite whatever is set as the color for the text.

$ is certainly understood by browsers. If you're referring to jQuery, I guess that the jQuery library isn;t included or referenced correcly.

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 October 26th, 2012, 05:53 PM
Authorized User
 
Join Date: Oct 2012
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Smile jquery error

I finally found my error. On page 537 we are instructed to enter script src after the ContentPlaceholder. I placed the source within the ContentPlaceholder so the javascript source was not available to the browsers.

I'll have to study the .Gridview, .Gridview a construct in depth to make sure I understand it.

Last edited by nick1248; October 26th, 2012 at 05:55 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Example of Java script in c# arunumane2002 Javascript How-To 4 March 14th, 2017 07:43 AM
Glyph doesn't show on pressing header page 537 jmahdi BOOK: Beginning ASP.NET 4 : in C# and VB 5 April 26th, 2011 10:21 AM
Shopping Cart Script in Chapter 15 groovybaz PHP How-To 4 June 7th, 2006 08:21 AM
Java vs Java Script functions joemorrison74 J2EE 0 July 6th, 2005 04:28 PM
Beginning VB.NET (4384-9), Pages 537 to 545 uwa Wrox Book Feedback 1 June 13th, 2004 12:30 PM





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