问题描述
我试图在按钮点击时调用javascript函数。按钮点击数据绑定到gridview,然后调用此函数。
我试图调用函数如下:
I am trying to call a javascript function on button click. On button click data binds to gridview and then this function is called.
I am trying to call function like:
ClientScript.RegisterClientScriptBlock(this.GetType(), "tmp", "CreateClickableLinks();", true);
并且函数存在于aspx文件中。
And function is present in aspx file.
<script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../Scripts/Validation.js"> </script>
<script type="text/javascript" src="../Scripts/progress.js"></script>
<script type="text/javascript">
function CreateClickableLinks() {
alert($("#<%=gvOpenProblems.ClientID %>").html());
}
</script>
当我运行代码时,我得到错误的对象预期:CreateClickableLinks
我调用函数的方式有什么问题或函数本身有问题吗?
When I run code I get error as Object expected : CreateClickableLinks
Is there anything wrong in the way I call function or there is something wrong with function itself?
推荐答案
当我运行代码时,我得到错误的对象预期:CreateClickableLinks
我调用函数的方式有什么问题或函数本身有问题吗?
When I run code I get error as Object expected : CreateClickableLinks
Is there anything wrong in the way I call function or there is something wrong with function itself?
这篇关于从后面的代码调用javascript函数不起作用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!