Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 145217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:23:04+00:00 2026-05-11T08:23:04+00:00

I have a question concerning functions with jQuery. I have a function that once

  • 0

I have a question concerning functions with jQuery. I have a function that once the browser is ready the function finds a specific table and then adds hover & click functionality to it.

I am trying to call this function from code behind in an asp .net page due to the fact that once someone adds to the database the update panel fires and retrieves a gridview (the table that has been affected by the function at document.ready). When it comes back it is the plain table again.

Here is the original functions:

$('#GridView1').find('tr').click(function(e) {                 var row = jQuery(this)                 //var bID = row.children('td:eq(0)').text();                 $('#tbHiddenBatchID').val(row.children('td:eq(0)').text());                 //Took out repetitive code, places values from table into modal                     e.preventDefault();                 $('#modalContentTest').modal({ position: ['25%', '5%'] });                 //row.addClass('highlight');                 //$('#tbEdit').val(bID);             });  //here is the function that adds hover styling $('#GridView1').find('tr').click(function() {             return $('td', this).length && !$('table', this).length         }).css({ background: 'ffffff' }).hover(             function() { $(this).css({ background: '#C1DAD7' }); },             function() {                 $(this).css({ background: '#ffffff' });              }); 

OK, what I tried to do is create a function, call it on document.ready and also in the code behind when after the database has been updated.

Here’s what I did:

function helpGrid() {             $('#GridView1').find('tr').click(function(e) {                 var row = jQuery(this)                 //var bID = row.children('td:eq(0)').text();                 $('#tbHiddenBatchID').val(row.children('td:eq(0)').text());                 //                 e.preventDefault();                 $('#modalContentTest').modal({ position: ['25%', '5%'] });                 //row.addClass('highlight');                 //$('#tbEdit').val(bID);             });  //Haven't even tried to add the hover stlying part yet; can't get this to work.         } 

When I try to call helpGrid(); I get an error that’s it not defined…

Obviously I’m a jQuery newb but I do have jQuery in Action & I’m scouring it now looking for an answer…

Please help..

Thanks!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:23:05+00:00Added an answer on May 11, 2026 at 8:23 am

    Since you are using an update panel, the entire page does not postback and the document.ready stuff never gets hit… Below is where you can add a function to run at the end of the update, so resetMyTableStuff(); is where you’ll want to do your magic…

    Try adding something like this…

    function pageLoad() {     if (!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) {         Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);         Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(initializeRequest);     } }  function endRequestHandler(sender, args) {      resetMyTableStuff(); }  function initializeRequest(sender, args) {       //just in case you need to do it... } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 205k
  • Answers 205k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer We have a similar situation here in that the 1st… May 12, 2026 at 8:59 pm
  • Editorial Team
    Editorial Team added an answer The following code should validate against a schema while deserializing.… May 12, 2026 at 8:59 pm
  • Editorial Team
    Editorial Team added an answer Hash calls the hash method on any objects used as… May 12, 2026 at 8:59 pm

Related Questions

I've been working with some event handling in Javascript and recently decided to migrate
I know I'll get a thousand Depends on what you're trying to do answers,
I have a function that returns this object: var result = AjaxUserToPlacePaging(); //this is
We currently have a custom inventory system used to track different assets. The items

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.