简体   繁体   English

OnclientClick - 服务器标签没有很好的错误

[英]OnclientClick - server tag not well formed error

OnClientClick = '<%# Eval("IsActive").ToString() == "True" ? OnClientClick ='<%#Eval(“IsActive”)。ToString()==“True”? "return confirm('Are you sure? This will remove the control from Brand-Mappings as well.');" “返回确认('你确定吗?这也将取消Brand-Mappings的控件。');” : "" %>' :“”%>'

Hi guys, what i want to do over here is that i want to enable return confirm only when IsActice evaluates to true. 大家好,我想在这里做的是,我想只在IsActice评估为真时启用返回确认。 I am getting server tag not formed error. 我收到服务器标签没有形成错误。

Please help. 请帮忙。

The problem is with your single quotes (eg ' ), you have one pair of single quotes at the beginning of the OnClientClick , and then another pair in the confirm() . 问题在于您的单引号(例如' ),您在OnClientClick的开头有一对单引号,然后在confirm()另一对。 Try escaping the second pair for instance: 例如,尝试转义第二对:

OnClientClick = '<%# Eval("IsActive").ToString() == "True" ? "return confirm(\"Are you sure? This will remove the control from Brand-Mappings as well.\");" : "" %>'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM