gpt4 book ai didi

c# - asp.net 从 Jquery UI 对话框中获取值返回到第一种形式

转载 作者:太空宇宙 更新时间:2023-11-03 13:48:00 24 4
gpt4 key购买 nike

我有下面的 JQuery 脚本

<script type="text/javascript">
$(function() {
$("#no-email-popup").dialog(
{
autoOpen: false,
buttons: {
"ok": function() {
alert($('#new_email').val());
alert(window.top.$("#new_email_label.").val());
// alert(window.top.$("#<%= new_email_label.ClientID %>").val());
$(this).dialog("close");

},
"cancel": function() {
$(this).dialog("close");
}
}

}
);
});
</script>

而模态 asp.net 是

<div id="no-email-popup">
<label>Enter Email: </label>
<input type="text" id="new_email" />
</div>

我想从 Pop up 获取值返回到 asp.net 页面并分配给那里的标签

<asp:Label ID="new_email_label" runat="server">test top window label</asp:Label>

我发现我什至不能改变这个标签的值

请帮助如何获得顶级 asp.net 页面的值(value)

最佳答案

使用 .val()<label/> 上不会给你所述标签的内部 html。您需要使用 .html()检索它,或 .html("something")进行设置。

关于c# - asp.net 从 Jquery UI 对话框中获取值返回到第一种形式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14627918/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com