Name does not exist in the current context ASP.NET
I was trying to bind a value from an input type text to the gridview but I keep having errors "CS0103: The name 'dateborrowedTextBox' does not exist in the current context"
Date borrowed:
<%--<asp:TextBox ID="dateborrowedTextBox" runat="server"
Text='<%# Bind("dateborrowed") %>' />--%>
<%--date picker --%>
<input type="text" runat="server" value='<%# Bind("dateborrowed") %>' name="dateborrowedTextBox" readonly="readonly" id="dateborrowedTextBox" />
<a href="#" onclick="cdp1.showCalendar(this, '<%= dateborrowed.ClientID %>')开发者_Python百科; return false;">Date Picker</a>
<br />
So how can I declare it inside my date picker?
Help would be much appreciated. Thanks in advance.
Your TextBox is commented out - change
<%--<asp:TextBox ID="dateborrowedTextBox" runat="server"
Text='<%# Bind("dateborrowed") %>' />--%>
to
<asp:TextBox ID="dateborrowedTextBox" runat="server"
Text='<%# Bind("dateborrowed")%>' />
精彩评论