Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > General Discussions > Partial View via Ajax and onload behavior

Not answered Partial View via Ajax and onload behavior

Feed from this thread
  • jim avatar

    Posted on May 15, 2011 (permalink)


    I'm trying to figure out if I am using the telerik MVC controls the wrong way.

    So, I've got a page, with all the telerik Javascript files being loaded by ScriptRegistrar.

    On the page is a link, when clicked, makes an Ajax.ActionLink call and returns a partial view that gets put onto the page.

    That Ajax.ActionLink is returning a telerik MVC control. But no matter which control I put in there, no actions on the control seems to register anything. I assume this is because the javascript bindings on the control get set up with the body onload, and the html/js returned by the ActionLink don't trigger an onload, so the controls never get initialized.

    Is there a way to manually cause the telerik widgets to initialize?

    Reply

  • jim avatar

    Posted on May 15, 2011 (permalink)

    The title of this thread is wrong, I'm not making a direction partial view call, but a Ajax.ActionLInk call.

    Reply

  • Posted on May 18, 2011 (permalink)

    There is a series of wiki pages that explain how to handle loading Partial Views containing Telerik controls on dynamically created tabs complete with sample code to download using the RAZOR View Engine or the ASPX View Engine:


    Telerik MVC : Dynamically Add a Tab to the TabStrip

    Telerik MVC : jQuery.ajax, Partial View and the Telerik Grid

    Telerik MVC : jQuery.ajax, Partial View and Telerik Controls

    Telerik MVC : Save Data From Telerik Controls Using jQuery.ajax

    There is also a page that lists a series of wiki pages related to Telerik MVC at:

    Telerik MVC Series

    Please let me know if this solves your problem or if you need additional help!

    Regards,

    John DeVight
    ASP.NET Wiki
    Practical Solutions for ASP.NET Developers
    http://aspnet.wikidot.com

    Reply

  • Posted on May 18, 2011 (permalink)

    I asked a similar question here :
    http://www.telerik.com/community/forums/aspnet-mvc/grid/how-to-load-grid-asynchronously-not-gridbuilder-databinding.aspx

    I'm have a working version of the modified Telerik source that can create a JSON version of any Telerik Widget containing the html for the widget, the configuration of the widget, the type of the widget and the widget selector.  This is so that I do NOT need to eval dynamic scripts. The overhead of parsing the json version of the html is small considering that many modern browsers have fast native implementations.

    I'll post a working version / diff to my original thread some time this week.

    Reply

  • Posted on May 18, 2011 (permalink)

    That's a really cool idea!  I look forward to reading the post on your original thread...

    Regards,

    John DeVight
    ASP.NET Wiki
    Practical Solutions for ASP.NET Developers
    http://aspnet.wikidot.com

    Reply

  • jim avatar

    Posted on May 19, 2011 (permalink)

    Turns out I should have read http://www.telerik.com/help/aspnet-mvc/using-with-partial-views-loaded-via-ajax.html

    Turns out I missed the whole thing related to OnSuccess.


    Reply

  • Max avatar

    Posted on Nov 28, 2011 (permalink)

    hey there

    Did you get an answer for your issue? I am having problems using Telerik controls with Ajax.ActionLink.
    No matter what I do I always get jQuery undefined. I am using this on my Layout page:

    @(Html.Telerik().ScriptRegistrar()
                  .jQuery(false)
                  .DefaultGroup(group => group
                  .Add("telerik.common.js")
                  .Add("telerik.component.js")
                  .Add("~/Scripts/MicrosoftAjax.js")
                  .Add("~/Scripts/MicrosoftMvcAjax.js")
                  .Add("~/Scripts/jquery.unobtrusive-ajax.js")
                  .Add("~/Scripts/jquery.validate.js")
                  .Add("~/Scripts/jquery.validate.unobtrusive.js")                                                                                                      .Combined(true).Compress(true)
                  )
    )

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > General Discussions > Partial View via Ajax and onload behavior