Need the clientId of a textbox inside a content control using javascript

前端 未结 1 1071
星月不相逢
星月不相逢 2021-01-15 01:52

I have a masterpage that contains all the javascript and inside the content control, there is a link that calls a javascript function and I want to pass the id once it\'s re

相关标签:
1条回答
  • 2021-01-15 02:13

    Try this instead (notice the <%= in the onclick attribute):

    <asp:TextBox ID="txtstart" runat="server" Width="20%" />
    <a title="Pick Date from Calendar" 
       onclick="calendarPicker('<%= txtstart.ClientId %>');" 
       href="javascript:void(0);">
    </a>
    
    0 讨论(0)
提交回复
热议问题