Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old April 9th, 2012, 06:26 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default Jquery Gridiview question

Can you use Jquery to manipulate and target Gridview or Dataview attributes like Height, width, Backcolor, Forecolor etc. Could you use JQuery to do something like this with a Gridview or a Dataview:

Code:
$(document).ready(function(){
  $('#musicians gridview1 tr:even').css('background-color','#dddddd');
});

I know you can achieve the same thing in the property pages or programatically in the markup section of your webpage, but is there any advantage that you can see by manipulating CSS with JQuery to achieve the same effect? The basic question I am trying to ask is can you target Dataview and Gridviews for manipulation using Jquery?
  #2 (permalink)  
Old April 9th, 2012, 06:42 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default Follow up question

Correct me if I am wrong but are Gridviews and Dataviews not displayed as HTML tables to the client when posted back? So if that is the case can you do all kinds of cool tricks with them using Jquery and CSS could you not? Could you theoretically do something like when you mouse over a row in a datagrid or gridview have the mouseover even kick off a Jquery script that changes the background color of the mouse overed row from white to blue and have the font that is blue before the mousover event change colors to white during the mouseover event? Could you do cool tricks like that using JQuery and CSS. Which beggars the question have you ever done a trick like that with any of the apps that you have written in the past? If so could you maybe think about incorporating some of those cool tricks in your next book on ASP.NET?
  #3 (permalink)  
Old April 10th, 2012, 02:06 AM
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

Quote:
Could you use JQuery to do something like this with a Gridview or a Dataview
The question that comes to mind is: why don't you try it out? You seem to have all the code in place to give it a spin....

Quote:
Correct me if I am wrong but are Gridviews and Dataviews not displayed as HTML tables to the client when posted back?
Absolutely (although a "postback" doesn't have anything to do with this. Controls like GridView render tables on the initial load / GET request as well). In the book I've demonstrated many times how to see what HTML is generated: open the Source of the page in the browser and you'll see the HTML for the control(s).

Quote:
... could you not
Could you theoretically ....
Could you do cool tricks...
Yes, but see question 1: just try it out and experiment. This is really the best way to learn. That's not to say you shouldn't be asking questions here but you can learn so much more and so much quicker by experimenting than by waiting for my answers.

Quote:
If so could you maybe think about
Done that already ;-) See page 535 and further for an explanation of the benefits, as well as an implementation example.

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!


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jquery question vbboyd BOOK: Beginning ASP.NET 4 : in C# and VB 1 February 3rd, 2012 04:37 AM
JQuery Khalil BOOK: Beginning ASP.NET 4 : in C# and VB 2 January 20th, 2012 11:39 PM
jQuery question member4953 BOOK: Beginning ASP.NET 4 : in C# and VB 4 July 7th, 2010 11:18 AM
jQuery | Basic Question gestalt Javascript How-To 3 January 9th, 2010 08:41 AM
Embedded Gridiview within a Formview rit01 ASP.NET 2.0 Basics 5 March 6th, 2006 11:52 AM





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