Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0need help with AjaxData:Gridview & DNN5need help with AjaxData:Gridview & DNN5
Previous
 
Next
New Post
2/17/2009 12:46 AM
 

Hello,

I am building a module that displays dynamic data using an AjaxData:Gridview and a webservice call.  When I have only one instance of the module on a tab, things are good.  However, when I want to have 2 on the page, things breakdown.  I've come at it a couple of different ways, but none seem to work.

The requirement is that each module will display data that is keyed to the module id.   The web service takes the moduleid as a parameter and return an array of data that gets bound to the grid.  This operation is done on a periodic (like every 10 seconds or so) basis.

The problem that I'm having is that the last module instance on the tab 'wins' when it comes to actually getting data.

I have something like this:

function pageLoad
{
window.setInterval(updateTime, 10000);
}

functiononLoadSuccess2(result)
{
GridView2.set_dataSource(UserInfo);
GridView2.dataBind();
}

function updateTime(sender) {
webservicecall( '<%=GridView2.ClientID %>', onLoadSuccess2);
}

There are a number of issues with the above, the bottom line is that it assumes that it's the only one on the given page.

In my dispair, I had (what I thought was) a good idea, to simply let the timer act as a singlton, pass the tabid to the web service, let the webservice build an array of responses (seems like a good idea, update all the grids with a single web service call!).  then find the individual gridviews in the response and bind each one to the correct data.  Seems like a good idea, but when you try to find the gridviews, you get back something else?  

eg:

var ctlid = "dnn_ctr" + ModuleID + "_AjaxDemo_GridView2"
var gridctl = document.getElementById(ctlid).parentElement;
gridctl.set_dataSource(UserInfo);
gridctl.dataBind();

but the result of document.getElementById() is not something you can use to bind the data source to. (thows an exception, and inspecting the retuned object, would indicate that it's not the gridview, but the table(?!?!). 

or am I just being dense and making things harder than they need to be?

 

 
New Post
2/17/2009 2:32 PM
 

I answered my own question, I think I was being dense and tired.

The answer is fairly straightforward (and looking at you in the webpage source).

 

var ctlid = "dnn_ctr" + ModuleID + "_AjaxDemo_GridView2"
var gridctl = $find(ctlid);
gridctl.set_dataSource(UserInfo);
gridctl.dataBind();

It always pays to sleep on it... thanks for listening. Jeff

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0need help with AjaxData:Gridview & DNN5need help with AjaxData:Gridview & DNN5


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out