Ajax.BeginForm Posts back when Window Url refreshed

3 posts, 0 answers
  1. Alex
    Alex avatar
    55 posts
    Member since:
    May 2015

    Posted 01 Mar Link to this post

    I have an Ajax.BeginForm that contains a button that allows you to open an existing Window (outside of the beginForm).

    When I call the window and refresh with a new url, no matter what url is used or what is displayed in it, after the window is refreshed it makes a post back to the server for the BeginForm.

    navbarWindowURL = "google.com";
    navbarWindowData.refresh({
        url: navbarWindowURL
    }).center();

     

    Is theresomething about calling this code that would cause the BeginForm to PostBack?

    I know you usually like example code to demonstrate the issue, but it would be really difficult to provide an example at this time.

     

  2. Alex
    Alex avatar
    55 posts
    Member since:
    May 2015

    Posted 02 Mar in reply to Alex Link to this post

    The issue turned out to be that the url I was loading, whether it was google.com or my own page was a full VIew instead of a partialView. Since the layout gets loaded with Views and not PartialViews I'm guessing the layout was the culprit, which makes sense.

     

    Are there any tip[s or tricks or conventions to avoid this kind of issue?

  3. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1333 posts

    Posted 03 Mar Link to this post

    Hello Alex,

    We do not have a resource with tips on the content you can load in a window, since this depends on the specific scenario. Through its content configuration option the Window offers a choice to either load the content from an external link or to call an action in the controller. Whether the action will return a view or a partial view is for the developer to decide, depending on the desired result.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top