I have a partial view and that partial is a registration form. On my main view i have a button and on that button click i am opening that partial view in a pop up by jquery.(means getting html of partial view by jquery ajax and binding it in a div '#add' and opening this div in pop up)
On my main view , i have this form
@using (Ajax.BeginForm("SaveCountry", "Manage","Country", new AjaxOptions { HttpMethod = "POST",OnSuccess="okk" }, new { enctype = "multipart/form-data" }))
{
<div id="add" class="modal fade" tabindex="-1" data-width="780">
</div>
}
Now, above thing is not working. Onsuccess JS function Okk is not getting called.
Now if i make above form like this:
@using (Ajax.BeginForm("SaveCountry", "Manage","Country", new AjaxOptions { HttpMethod = "POST",OnSuccess="okk" }, new { enctype = "multipart/form-data" }))
{
<input type="submit" value="Click me">
}
then OnSuccess JS function Okk is working fine.
Does it mean that if in a form submit button is dynamically added by jquery then ajax onsuccess will not work or we have to find some other way.
What I have tried:
I tried nothing. Please suggest some answers.