How to get child controls correct id to client side

前端 未结 1 810
旧时难觅i
旧时难觅i 2021-01-21 20:59

I am working on ASP.NET and not using any ASP.NET\'s AJAX framework.
Now I am trying to update the contents of the textboxes and dropdowns in the Grid controls cell on clie

相关标签:
1条回答
  • 2021-01-21 21:27

    If you want the id of a control in the same control/page you can do that this way:

    <%=txtControl.ClientID%>
    

    If you want the id of a control inside a usercontrol you can do that like this:

    <%=userControl.FindControl("txtControl").ClientID%>
    

    Where "txtControl" is the server id of the control and "userControl" is the server id of the usercontrol.

    0 讨论(0)
提交回复
热议问题