我需要从Jquery函数重定向到clasic ascx形式(无mvc)。还需要传递一个id。从Jquery重定向到.aspx文件
这里是我的代码,
jQuery(document).ready(function() {
var rows = jQuery(".emailListRow");
jQuery.each(rows, function() {
var hiddenVal = jQuery(this).find('input[type="hidden"]').val();
jQuery(this).append("<input type='button' id='btnDetails' value='Details' onClientClick='redirectTo(" + hiddenVal + ")' />");
});
});
function redirectTo(id) {
window.location.href = "Forms/Details.aspx?id=" + id;
}
这不工作...犯规抛出任何错误,无论是。
帮助?也许我错了aspx的parth? (这是一个位于一个文件夹中的ascx,其内的另一个文件夹(Forms)放置在Details.aspx中。
题外话:?ID应该_unique_ – undefined 2013-04-29 20:29:37
它们是唯一 – devMd 2013-04-29 20:37:06
你不追加几个元素与此属性'ID ='btnDetails'' – undefined 2013-04-29 20:38:28