Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用java脚本动态创建按钮_C#_Javascript_Asp.net - Fatal编程技术网

C# 如何使用java脚本动态创建按钮

C# 如何使用java脚本动态创建按钮,c#,javascript,asp.net,C#,Javascript,Asp.net,c 其显示错误为对象不支持属性或方法“live”live已被定价使用: 使用on而不是liveI我仍然在同一个平台上,JavaScript运行时错误:对象不支持属性或方法“on”您使用jQuery吗?如果我使用jQuery,则类型保持不变,即,意味着我只想知道如果使用jQuery,会有什么不同?包括以下内容:code.jQuery.com/jQuery-1.11.0.min.js> foreach (DataRow Row in oDs.Tables[0].Rows)

c

其显示错误为对象不支持属性或方法“live”

live已被定价使用:


使用on而不是liveI我仍然在同一个平台上,JavaScript运行时错误:对象不支持属性或方法“on”您使用jQuery吗?如果我使用jQuery,则类型保持不变,即,意味着我只想知道如果使用jQuery,会有什么不同?包括以下内容:code.jQuery.com/jQuery-1.11.0.min.js>
 foreach (DataRow Row in oDs.Tables[0].Rows)
                    {
                        LitPreferances.Text += "<Li ID=LI_" + Row["pk_Preference_Branch_ID"].ToString() +"_"+ Row["pk_Preference_BranchType_ID"].ToString() +">" + Row["Branch_Name"].ToString() + "&nbsp;&nbsp;<a href='#' title='delete' class='itemDelete' onclick='return RemoveBranch();' tooltip='Remove Branch'>Remove</a></Li>";
                    }
  function RemoveBranch() {
        $('.itemDelete').live('click',
    function () {
        $(this).closest('Li').remove();
    }
);
        return false;
        }
<html>
    <head>
        <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
          .
          .
          .
    </head>
</html>

function RemoveBranch() {
        $('body').on('click','.itemDelete',function () {
        $(this).closest('Li').remove();
    });
 return false;
}       
I got one solution over there, just simply used

 function RemoveBranch() { $("#ULPreferences li").click(function () { 
$(this).remove(); }); }