且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Javascript无法在asp.net用户控件中运行

更新时间:2023-12-06 09:53:52

get(<% = lblStatus.ClientID % > )。innerHTML =正在加载......;
__doPostBack(buttonid,);
// __doPostBack(<% = btnSearch.UniqueID %> , );
}
< / script >
get("<%=lblStatus.ClientID %>").innerHTML = "Loading..."; __doPostBack(buttonid, ""); // __doPostBack("<%=btnSearch.UniqueID %>", ""); } </script>





及其正常工作。下一个用于双击的是







and its working properly. the next I am using for a doubleclick is


<script type="text/javascript">
    function clickButton(e, buttonid) {
        debugger;
        var evt = e ? e : window.event;
        var bt = document.getElementById(buttonid);
        if (bt) {
            bt.click();
        }
    }
      </script>







且无法使用




and it is not working


我可以看到你的用户控件有一个问题。



既然你没有外化你的用户控件的javascript,那么如果用户控件是在页面中多次使用,然后javascript代码将重复。
I can see one issue with your usercontrol.

Since you have not externalized your user control's javascript, so if the user control is used mutiple times in a page then the javascript code will get repeated.