This is a migrated thread and some comments may be shown as answers.

Ajax.BeginForm Posts back when Window Url refreshed

2 Answers 26 Views
Window
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 01 Mar 2017, 11:21 PM

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 Answers, 1 is accepted

Sort by
0
Alex
Top achievements
Rank 1
answered on 02 Mar 2017, 02:02 PM

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?

0
Ivan Danchev
Telerik team
answered on 03 Mar 2017, 09:37 AM
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.
Tags
Window
Asked by
Alex
Top achievements
Rank 1
Answers by
Alex
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or