Pull module properties using AJAX call

Posted by Ilya Nemtsev on July 1, 2015

Hi team,

Is there a way to pull module properties in my action if I am making an ajax call, I know you can pull ContentDefinitons, but is there a way to do this for module properties? This would be conventient because we can populate all the properties we need in the module and then the page and its ajax calls can rely on those properties.

Thanks.

   0 people like this question
15 30 50   per page
   
  
 
 
   
Submit
Thank you for your help Joel, we found a less beautiful way to do it already, but your solution is much nicer. We will use this method next time.
Posted By: Ilya Nemtsev

You will have to pass in the Page path or Page ID, call Agility.Web.Data.GetPage, and then loop through the ContentSections on the Page object to get the Module.

Hopefully that works for you.  Let me know if you need example code for that.

Joel Varty


Posted By: Joel

Hi,
I understood that I needed an action in my controller for this, however my confusion lies in how to access the module data, we have always obtained & accessed the module data in this way:

public ActionResult PromotionActionExample(Module_PromotionActionExample module)
{
    //Use the module here somehow
}

but with an ajax action, how would one obtain/access "module"?
Posted By: Ilya Nemtsev

If you need to pull module properties in an AJAX call in the website, you will have to write a controller action to get that data for you and output it as JSON.

Does that make sense? 

Joel Varty


Posted By: Joel

Previous Next

LOGIN

Log in with your Agility username and password or
register for the site




Log In

REGISTER












Register

FORGOT PASSWORD