I have ListView(in the update panel) associated with ObjectDataSource(connected to an NHibernate object), and in EditItemTemplateI use
ListView
ObjectDataSource
EditItemTemplate
Text='<%# Bind("HideLocation")%>'
to bind to the string property of the object.
When I click the "Edit" button (twice, I have another problem) and look at the code in Chrome, the output looks like this:
<div class="InputLine InputLineLevel2"> <div class="InputLabel">Hide Location:</div> <div class="InputControl"> " In locker 2317" <input name="ctl00$MainContentPlaceholder$ItemDetailsListView$ctrl0$txtItemHideLocation" type="text" maxlength="128" id="ctl00_MainContentPlaceholder_ItemDetailsListView_ctrl0_txtItemHideLocation" style="width:300px;"> </div> </div>
The .aspx code is as follows:
<asp:UpdatePanel ID="ItemDetailsUpdatePanel" UpdateMode="Always" runat="server"> <asp:ListView ID="ItemDetailsListView" runat="server" ...> <EditItemTemplate> <fieldset class="FieldsetLevel2"> <legend>Edit Item: <%# Eval("SearchItem.SearchItemName") %></legend> <div class="InputLine InputLineLevel2"> <div class="InputLabel">Hide Location:</div> <div class="InputControl"> <asp:TextBox ID="txtItemHideLocation" Width="300px" Text='<%# Bind("HideLocation")%>' runat="server"></asp:TextBox> </div> </div> ... a bunch of other controls & end tags
Any ideas why the value of the associated data (in this case: In the 2317 cabinet) appears outside the text field instead of the data content?
, , . , .
, . , , TextBox. -, , , datasource. ListView, . ISet, .
, , (-, , ), xDataSource, , ListView. , , , DataBound.
-, , . , EditItemIndex. ( , PreRender), , ListView. ( ) , ( , , ).
databind EditIndex, , TextBox .
Source: https://habr.com/ru/post/1757344/More articles:Проблемы с выпуском DropDownList.Items.Addrange и выбор значения - c#Calling Python instance methods in function decorators - pythonHow to disable GestureListener in android? - androidWhy use "// ->" in javascript - javascriptКонкатенация строк в Python - pythonAny advantage of using "static" for private consts? - actionscriptCommand Line Arguments in C - cEnable J2EE Web Application Resource Cache - jsf-2Is there any way to check if updating SVN will lead to a conflict? - svnСлайд в анимации при обновлении экрана на Android - androidAll Articles