I have a gridview that displays dynamic rows, each with a textbox for a date. I want to use a javascript popup calendar for each row's textbox. I'm trying to use the ClientID, but I'm getting this error: "error CS0103: The name 'txtRequestDate' does not exist in the current context"
Here's the textbox code:
<asp:TextBox Text='' ID="txtRequestDate" Width="75" runat="server"></asp:TextBox><img src="/_layouts/images/calendar.gif"
alt="Select Date" width="16" height="15" onclick="javascript:NewCal('<%= txtRequestDate.ClientID %>','ddmmmyyyy'); return false;" />
Once rednered, the source input box looks like this:
<input name="ctl00$m$g_d1b32122_5e08_4535_91f1_64358c13bf12$ctl00$gvCheckout$ctl02$txtRequestDate" type="text" id="ctl00_m_g_d1b32122_5e08_4535_91f1_64358c13bf12_ctl00_gvCheckout_ctl02_txtRequestDate" style="width:75px;" />
Apparently the clientid isn't enough to get the unique textbox in each row. Any ideas? Thanks!
Here's the textbox code:
<asp:TextBox Text='' ID="txtRequestDate" Width="75" runat="server"></asp:TextBox><img src="/_layouts/images/calendar.gif"
alt="Select Date" width="16" height="15" onclick="javascript:NewCal('<%= txtRequestDate.ClientID %>','ddmmmyyyy'); return false;" />
Once rednered, the source input box looks like this:
<input name="ctl00$m$g_d1b32122_5e08_4535_91f1_64358c13bf12$ctl00$gvCheckout$ctl02$txtRequestDate" type="text" id="ctl00_m_g_d1b32122_5e08_4535_91f1_64358c13bf12_ctl00_gvCheckout_ctl02_txtRequestDate" style="width:75px;" />
Apparently the clientid isn't enough to get the unique textbox in each row. Any ideas? Thanks!