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#代码的其他地方。你有什么建议?
答案 0 :(得分:1)
移动逻辑以显示/隐藏元素到OpenPaymentWindow
JavaScript函数并使用jQuery选择器,如下所示:
function OpenPaymentWindow() {
// Logic to open payment window here
// Show/hide DOM elements here
$('#fsCreditCard').hide();
$('#fsAfterCreditCard').show();
$('#fsPaymentOptions').hide();
}