How to get asp.net client id at external javascript file

前端 未结 5 1527
暖寄归人
暖寄归人 2020-11-28 12:58

When I use embedded javascript functions I can get client id of elements with this code:

document.getElementById(\'<%=buttonXXX         


        
5条回答
  •  攒了一身酷
    2020-11-28 13:15

    I know old question but with jquery u can use this approache:

    Aspx file

    
    

    external js file

    $("[ClientID='btnCalculate']").
    

    https://lanitdev.wordpress.com/2009/06/08/extending-jquery-to-select-asp-controls/

提交回复
热议问题