Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Webparts with Ajax View modes: 
User avatar
Certified Developer 12
Certified Developer 12
chetan2309-gmail - 8/30/2013 1:10:35 PM
   
Webparts with Ajax
Hi,

I have a repeater which I use to show article teasers on a page. I use custom drop down, which when I click reloads the webpart by passing query string parameters.

In my webpart, I do handling of this stuff to get desired result.

Now, how can I achieve this via ajax so that it does not result in a page reload?

Any pointers to that? I saw "Ajax Use update panel", however I don't how to use that and if by using that can I achieve what is intended?

Thanks for your continuous support!!

Regards,
Chetan

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/30/2013 11:36:35 PM
   
RE:Webparts with Ajax
Have you tried checking the box in the webpart's properties and seeing if it gives you the desired results? I'd suggest doing that first and seeing what happens. If I remember right from testing, it simply wraps an asp : UpdatePanel around the content of the webpart.

User avatar
Certified Developer 12
Certified Developer 12
chetan2309-gmail - 8/31/2013 12:31:55 AM
   
RE:Webparts with Ajax
Hi FroggEye,

Nothing happened I tried. I am clueless how a custom dropdown action will interact with a webpart when in my implementation they don't have any connection. On click of my custom dropdown I call a method like this

window.location.search = 'cat='+ category;

and I handle the queryString cat in my webpart and perform a relevant search. No wonder this results is page-reload.

Thanks

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/31/2013 1:14:58 AM
   
RE:Webparts with Ajax
Hi,

Have you tried following this KB article?

Best regards,
Juraj Ondrus

User avatar
Certified Developer 12
Certified Developer 12
chetan2309-gmail - 8/31/2013 1:42:42 AM
   
RE:Webparts with Ajax
Thanks kentico_jurajo,

This might help me in some other issue. However, what I am looking forward for is to have webpart update its data without page reload.


User avatar
Member
Member
kentico_sandroj - 9/2/2013 1:55:55 PM
   
RE:Webparts with Ajax
Hello,

In that case, you would have to take another approach for filtering by category which does not include modifying the querystring. You would either develop a custom Web part or wrap two Web parts in an Update Panel and use the KB article that Juraj provided to share information between them. The page is posting back because you are changing the URL by modifying the querystring. More information about AJAX support is available here. Additionally, repeater and pager update panel example. The update panel property is also available for Web part zones (/CMSHelp/index.html?webpartzoneproperties.htm).

Please let me know if you have any questions.

Best Regards,
Sandro Jankovic