What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 951 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > How to call javascript for gridview? ...
Oswaldlily

How to call javascript for gridview?

Replies: 1 | Posted by: Oswaldlily on 8/1/2012 | Category: ASP.NET Forums | Views: 424 | Status: [Member] | Points: 10  


In javascript file I has

(highlight when hover over fields)
$(document).ready(function () {

$("#divGridView table tbody tr").mouseover(function () {

$(this).addClass("highlightRow");

}).mouseout(function () { $(this).removeClass('highlightRow'); })

});

I drag and used under content page..
Now i want this javascript for my gridview.how to call?
<div class="????">
<asp:gridview....></gridview>
</div">


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Ogipansrk
Ogipansrk  
Posted on: 8/2/2012 5:35:38 AM
Level: Starter | Status: [Member] | Points: 25

Step1: Drag and Drop Jquery Library on your page;

Step2: Add the below code to your page in javascript

$(document).ready(function () {
$("#<%=GridView1.ClientID%> tr:has(td)").hover(function () {
$(this).css("background-color", "Lightgrey");
}, function () {
$(this).css("background-color", "#ffffff");
});
});

Just run your app.

Oswaldlily, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/23/2013 10:31:54 AM