0

I have a gridview named gdLog and I need to trigger it's OnNeedDataSource event. How do you do this from javascript or jQuery?

I've tried doing a __

doPostBack('<%= gdLog.ClientID %>', 'OnNeedDataSource');

but it doesn't trigger the event method just a pageload.

Shaharyar
  • 12,254
  • 4
  • 46
  • 66
Oscar
  • 1,025
  • 2
  • 15
  • 25
  • What are you trying to achieve with that? – emerson.marini Jul 24 '13 at 15:28
  • I'm having this problem: http://stackoverflow.com/questions/16096668/to-display-the-webpage-again-the-web-browser-needs-to-resend-the-information, but by doing window.opener.location.reload(); I'm trying to refresh the gridview data without having to do the reload(). So, basically I have a popup window that changes a value in the database. Once the popup window closes, I need to have the new data show up in the gridview. – Oscar Jul 24 '13 at 15:31
  • I got it, but I still can't see why are you trying to fire a GridView event. – emerson.marini Jul 24 '13 at 15:33
  • 1
    If all you want is to refresh the GridView contents, without reloading the page, place it into an UpdatePanel and do it asynchronously. – emerson.marini Jul 24 '13 at 15:33
  • Or, the simplest way... `.DataBind()`. – emerson.marini Jul 24 '13 at 15:35

1 Answers1

0

After reading your comment which contains information that should be part of the question, what you're looking for is a way of refreshing the GridView with new data, as a result of some change occurred on a popup window.

What do you need maybe can be found in this post:

Call .NET method asynchronously and bind to grid upon completion

Or in this article:

http://oakdome.com/programming/ASP_NET_AsyncGridView.php

Community
  • 1
  • 1
emerson.marini
  • 9,331
  • 2
  • 29
  • 46