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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesjQuery AJAX call to module control....bit of a challenge!jQuery AJAX call to module control....bit of a challenge!
Previous
 
Next
New Post
4/11/2012 5:40 PM
 

Hi All

I have a module where I am using jQuery AJAX calls back to a module which all works great,

However I have an issue with a Gridview update. The idea is that the a jQuery UI form is presented, on ok the callback is completed and some updates to the database are made, and the values rebound to the gridview.

I would like the gridview to get updated. One approach I tried was to render the Gridview as html and append this to the containing div, but the issue here is that there is a row command control on the gridview as well so the render falls foul of the Page event validation.

I'd really like to use jQuery in this way on the control and avoid if possible using the .net AJAX stuff with DNN partial rendering etc. (tied in with backward compatability etc). Does anyone have any ideas how the gridview might work in this scenario?

Rgds

Colm


Colm Ryan Director
3rd i IT and Business Services Limited

www.actravia.com
Registration and Booking Solutions for Dotnetnuke
www.3rdi.ie
IMCA Registered Management Consulting Practice. Business and IT Strategy, IT Project Management and Product Development
 
New Post
4/15/2012 4:24 AM
 
you're somewhat approaching this in the wrong way - ajax pulls down data to render against client html, whereas the gridview is a server control so is already built before your ajax request occurs - you would be much better off either using a jquery/javascript grid or using some templating (jquery templates/knockoutjs) to produce a gridlayout. Alternativey if you want to use the gridview, get the date from service code and databind it (you will not get the advantage of offloading the async request to the client)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
4/15/2012 5:57 AM
 
Hi Cathal

Thanks for the response. I realise that it might not have been ideal but I was working with a pre-existing gridview which I didn't want to have to rework the binding logic, paging and event handlers etc.

I tried a couple of things in the end which had partial success. The first was in the server code in the ajax code was to drop the command events and then to call render control server side on the gridview which will work when there are no command controls on it, then bind the resulting html using jQuery append to the original div...worked but dropped the command which wasn't ideal.

Second thing I tried was to call __doPostBack in the onSuccess logic after the Ajax control. This re-rendered the gridview but causes a postback to do it which was not exactly what I wanted. It did however still allow me to use the nice jQueryUI form that was initiating the jQuery ajax call and that was the main reason for going down this route in the first place.

All said though, I'll have to look more into using client side layouts for this in the long run. Thanks for the pointers Cathal.

Rgds
Colm

Colm Ryan Director
3rd i IT and Business Services Limited

www.actravia.com
Registration and Booking Solutions for Dotnetnuke
www.3rdi.ie
IMCA Registered Management Consulting Practice. Business and IT Strategy, IT Project Management and Product Development
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesjQuery AJAX call to module control....bit of a challenge!jQuery AJAX call to module control....bit of a challenge!


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