Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 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 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?
Reply With Quote
  #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?
Reply With Quote
  #3 (permalink)  
Old April 10th, 2012, 02:06 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 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!
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
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



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


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