나는 멋진 상자에 로그인 페이지를 가지고 로그인의 클릭에 나는 새 탭 에서 열린 보안 페이지를 원하고이 코드프로그래밍
// 코드에 btnlogin_click
에서 사용FormsAuthentication.RedirectFromLoginPage(loginID, false);
string redirectTo = GetResPath("/webPages/Default.aspx");
ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "add2", "parent.jQuery.redirTo='" + redirectTo + "'; parent.jQuery.fancybox.close();", true);
aspx 페이지
<script type="text/javascript">
$(document).ready(function() {
$('[id*=logn_btn_new]').fancybox({
'width': 480,
'height': 280,
'padding': 10,
'margin': 10,
'hideOnOverlayClick': false,
'scrolling': 'no',
'autoScale': false,
'transitionIn': 'none',
'transitionOut': 'none',
'type': 'iframe',
'onClosed': function() {
try {
if ($.redirTo != null && $.redirTo.length > 0) {
var pop = window.open($.redirTo, '_newtab');
if (pop == null) {
alert("Please allow popups.");
}
}
}
catch (err) {
alert(err);
}
}
});
});
</script>
에
// 및 redirTo 숨겨진 fielld입니다.
새 탭에서 페이지를 열 수 없습니까? 아무도 도와 드릴 수 있습니까?
"redirTo는 숨겨진 필드입니다."- 그래서 $ ('redirTo') .val()'또는'$ ('input.redirTo') .val()'보다는'$ .redirTo '? 왜 그런 식으로 액세스하고 있습니까? jQuery 객체에 값을 저장 했습니까? (왜 그곳에 저장하겠습니까?) – Rup