I am using .Net 4.0 and a lot of solution currently on the Internet are not working, for example non-exist library.
The whole story is: I have a main view, and within it there is 1 iframe. By clicking on the [submit] button on main view, it will trigger its own POST action as well as I make it trigger the POST of iframe by using javascript as follows:
function TriggerIframeAction() {
var iframe = document.getElementById("myIframe");
var iframeForm = iframe.contentWindow.document.getElementById("myIframeForm");
iframeForm.submit();
}
However I need to make sure main frame's post always runs BEFORE iframe's post, so I am thinking to let main frame's action to trigger that JS.
I know Ajax.BeginForm(...OnSuccess...) may help. However it seems just mean the connection is successfully? If I put my validation code in main frame's action & make ModelState.IsValid = false, "OnSuccess" (so the iframe post) will still be executed which is not what I want ....
Correct me if I am wrong.