ASP.NET MVC How do i close fancybox on form post
- by Azhar Rana
I have a fancybox popup with a form inside it. When the form is posted it all works fine BUT after it is posted it redirects to the view and shows it on a full page.
What i want is for the popup for to be posted and the fancy box to be closed.
Here is my code
Main Page This opens the popup fine
<%: Html.ActionLink("Add Person Box", "AddTest", Nothing, New With {.class = "fbox"})%>
<script type="text/javascript">
$(document).ready(function () {
$(".fbox").fancybox();
});
</script>
Popup page
<% Using Html.BeginForm() %>
<input type="submit" value="Save Person" />
<% End Using %>
Again this submits fine but redirects to itself in full screen mode. i just want the form to be posted and the fancy box to be closed.