user1790300
user1790300

Reputation: 1735

How do I close Kendo UI modal popup from Ajax.BeginForm onSuccess event?

I am using Kendo UI with asp.net MVC 3 design pattern. I have a page that uses a modal panel and the content is loading from a .cshtml page that has an Ajax.BeginForm contained within it.

Here is my dilemma: I would like to close the window when the onSuccess event is fired on the ajax form. What would I have to do since this would not be a button click? Here is the code I found for the case of a button click:

$( buttonInsideWindow ).closest(".k-window-content").data("kendoWindow").close()

I am not sure what code I need to use from onSuccess event.

Upvotes: 1

Views: 2432

Answers (1)

U.P
U.P

Reputation: 7442

It is fairly simple.

In you onSuccess event handler, you can use the Id of your model window to close it

$("#windowId").data("kendoWindow").close();

Upvotes: 2

Related Questions