I trying submit a picture in a Iframe (fancybox), but if I close the iframe I don’t get the Data on the server.
(this code are inside the frame)
<a class="button" id="finishButton" onclick="closeME()"><span>@PhotoPremier.Resources.Global.btnSubmit</span></a>
<script>
function closeME() {
if (ValidationToSubmit() == true) {
$('#FormToSubmit').submit();
}
}
$('#FormToSubmit').submit(function() {
event.preventDefault();
parent.$.fancybox.close();
});
</script>
My workaround is very simple and a little creative.
I redirect to a simples page (for me a create a shared page [MVC], for used in all situation) and this page get the new URL and by javascript redirect to new destination and closed the iframe.