简体   繁体   English

写一个函数来创建一个字符串(JavaScript),然后将其添加到按钮作为其属性?

[英]writing a function which creates a string (javascript) and then add it to a button as its attribute?

I have a Button in my .aspx web form and use c# 3.0 I want to add a javascript function to its attribute as its "onclick" event handler. 我在.aspx网络表单中有一个Button,并使用c#3.0,我想为其属性添加一个javascript函数作为其“ onclick”事件处理程序。 the function has 1 parameter in order to check whether onclick javascript should get a confirmation from user or not. 该函数具有1个参数,以检查onclick javascript是否应获得用户确认。 The parameter Datatype is bool But when I send true, execution of the program halts and show me a message that True is not defined!! 参数Datatype是bool但是,当我发送true时,程序的执行将暂停并显示一条消息,提示未定义True!

What's wrong? 怎么了?

True必须在javascript中为小写。

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

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