1
cshtml 파일에서 target = "_ parent"를 사용하고 싶지 않습니다. 나는 서버 측에서 그것을 닫고 싶다. 즉, 새 창으로 리디렉션하기위한 C# 액션입니다.iframe in C# MVC
현재 동일한 Iframe에서 열려 있습니다.
cshtml 파일에서 target = "_ parent"를 사용하고 싶지 않습니다. 나는 서버 측에서 그것을 닫고 싶다. 즉, 새 창으로 리디렉션하기위한 C# 액션입니다.iframe in C# MVC
현재 동일한 Iframe에서 열려 있습니다.
약간의 노력 끝에 위에서 언급 한 문제에 대한 해결책을 찾았습니다.
성공적인 게시시 새보기 .cshtml로 리디렉션하고 거기에 javascript가 있습니다. 당신이 보는대로
<script type="text/javascript">
$(document).ready(function() {
var IframeModal = top.window.document.getElementById('myIframeModal');
if ($(QuickAddUserModal).css('display') == "block") {
parent.iFrameClose('#IframeModal');
}
if ('@Model.GoToUserRecordOnSave'=='False') {
parent.window.location.reload();
}
else {
var url = '@Url.Action("ViewUser", "Users", new { id = Model.Id })';
parent.window.location.href = url;
}
});
</script>