我試圖綁定從日期選擇器到asp文本框的選定值,但我有這個錯誤:'this._targetEl .value.length'爲空或不是對象。錯誤:'this._targetEl.value.length'爲空或不是對象ASP.NET
下面的代碼:
<InsertItemTemplate>
Book Title:
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="booktitleDataSource" DataTextField="booktitle"
DataValueField="bookid" SelectedValue='<%# Bind("bookid", "{0}") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="booktitleDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:LibrarySystemConnectionString %>"
SelectCommand="SELECT [bookid], [booktitle] FROM [TblBooks]">
</asp:SqlDataSource>
<br />
Employee PIN:
<asp:TextBox ID="employeeidTextBox" runat="server"
Text='<%# Bind("employeeid") %>' />
<br />
Department:
<asp:TextBox ID="departmentTextBox" runat="server"
Text='<%# Bind("department") %>' />
<br />
Date borrowed:
<asp:TextBox ID="dateborrowedTextBox" runat="server" Text='<%# Bind("dateborrowed") %>' />
<%--<input type="text" name="dateborrowedTextBox" readonly="readonly" id="dateborrowedTextBox">--%>
<a href="#" onclick="cdp1.showCalendar(this, 'dateborrowedTextBox'); return false;">Date Picker</a>
<br />
<asp:Button ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
<asp:Button ID="InsertCancelButton" runat="server" CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
這是工作,當我 嘗試使用<input type="text" name="dateborrowed" readonly="readonly" id="dateborrowedTextBox">
但是當我嘗試使用ASP:文本框,我不能從日期選擇器選擇的值傳遞到文本框。那麼我哪裏錯了?有沒有辦法編程日期選擇器鏈接來調用彈出日曆? (它在Java btw)
幫助將不勝感激! 在此先感謝。
謝謝!我會試一試。 – Loupi 2011-05-13 03:07:08
嗯,它有一個錯誤。 System.NullReferenceException:未將對象引用設置爲對象的實例。它必須是我認爲的JavaScript,我再次檢查它... – Loupi 2011-05-13 03:18:32