1
我用下面的方法弹出一个带网格的模态,然后将选定的值返回给父节点。这在一个独立的项目中运行良好,只有一个aspx页面。jquery返回值
<script>
function openDialog() {
$("#MyModal").dialog('open');
}
function CloseDialog() {
$("#MyModal").dialog('close');
$("input#txtName").val($("input#hdnName").val());
$("input#txtFName").val($("input#hdnFName").val());
$("input#txtLName").val($("input#hdnLName").val());
}
$(document).ready(function() {
$("#MyModal").dialog({ autoOpen: false });
//event can fire on the click of HTML Table
$("#<%=grdModal.UniqueID%> tr").click(function() {
var id = $(this).find("td:nth-child(1)").html();
var Name = $(this).find("td:nth-child(2)").html();
var fName = $(this).find("td:nth-child(3)").html();
var lName = $(this).find("td:nth-child(4)").html();
$("input#hdnId").val(id);
$("input#hdnName").val(Name);
$("input#hdnFName").val(fName);
$("input#hdnLName").val(lName);
});
// Change the Mouse Pointer on grid row hover
$('#<%=grdModal.ClientID%> tr').mouseover(function() {
$(this).css({ cursor: "hand", cursor: "pointer" });
});
</script>
我在gridview中填充了代码隐藏的虚拟数据表。 现在,当我把它放到我的解决方案中时,它不会将值返回给父项。 任何线索?我在解决方案中粘贴了相同的代码。
“回到父母”是什么意思?这是所有网页,无论你如何使用jQuery进行视觉更改。如果你删除了jquery,该页面是否工作? – Dave 2011-02-24 14:26:17