gpt4 book ai didi

c# - 如何隐藏字段集?

转载 作者:行者123 更新时间:2023-11-28 01:49:37 28 4
gpt4 key购买 nike

fsCreditCard.Visible = false;

在一些代码隐藏的 C# 代码中工作,以隐藏在 .aspx 代码中定义的字段集 fsCreditCard,如下所示:

<fieldset id="fsCreditCard" runat="server" visible="false">
<legend>Credit Card</legend>
<ul style="margin:50px;font-size:16px;">
<li>
<u><b><a href="javascript:OpenPaymentWindow(); fsCreditCard.Visible= false; fsAfterCreditCard.Visible = true; fsPaymentOptions.Visible=false;">Click here</a></b></u> now to open the PayPal payment window and complete your payment. If you have any trouble, please make sure any pop up blockers are disabled and reload this page.<br /><br />
</li>
</ul>
</fieldset>

现在,当用户单击超链接“Click Here”时,“OpenPaymentWindow 实际上已被处理,但“fsCreditCard.Visible= false; fsAfterCreditCard.Visible = true;"命令未完成。它们似乎不是 javascript 命令,它们存在于 C# 代码中的其他位置。您有什么建议?

最佳答案

将显示/隐藏元素的逻辑移至 OpenPaymentWindow JavaScript 函数中并使用 jQuery 选择器,如下所示:

function OpenPaymentWindow() {
// Logic to open payment window here

// Show/hide DOM elements here
$('#fsCreditCard').hide();
$('#fsAfterCreditCard').show();
$('#fsPaymentOptions').hide();
}

关于c# - 如何隐藏字段集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19852297/

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