使用javascript中的参数重定向到页面

时间:2010-12-11 05:14:11

标签: javascript asp.net-mvc asp.net-mvc-2

function AddNew() {
            var _IsInterview = '<%: Session["IsInterview"] != null ? Session["IsInterview"] : "" %>';
            if (_IsInterview .toLowerCase() == 'true') {
                parent.$.fn.colorbox({ href: '/Vehicles/SaveRepository/?t=' + Math.random(), height: _popupHeight, width: _popupWidth, overlayClose: false });
            } else {
                var id4 = $("#BusinessId").val();
                parent.$.fn.colorbox({ href: '/Vehicles/SaveRepository/?id=0&id2=Vehicles&id3=Index&/' + id4 + '&t=' + Math.random(), height: _popupHeight, width: _popupWidth, overlayClose: false });
            }
        }

id4值未传递

1 个答案:

答案 0 :(得分:1)

假设其他一切都是正确的:

function AddNew() {
    var _IsInterview = '<%: Session["IsInterview"] != null ? Session["IsInterview"] : "" %>';
    if (_IsInterview .toLowerCase() == 'true') {
        parent.$.fn.colorbox({ href: '/Vehicles/SaveRepository/?t=' + Math.random(), height: _popupHeight, width: _popupWidth, overlayClose: false });
    } else {
        var id4 = $("#BusinessId").val();
        parent.$.fn.colorbox({ href: '/Vehicles/SaveRepository/?id=0&id2=Vehicles&id3=Index&id4=' + id4 + '&t=' + Math.random(), height: _popupHeight, width: _popupWidth, overlayClose: false });
    }
}

你有“/”而不是“id4 =”。