473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problems with <EditItemTemplate> and setting DataField for textbox

Hi Everyone,

I wanted to create a large text box (a textarea) for displaying some
large information for editing. I am using a DetailsView control with
an SQL data source, but every time I try to update my custom textbox
field it doesn't save to the database. I have done extensive testing /
researching and have found that this asp:textbox is not even in
the )OldItems or NewItems arrays of information. Can someone please
help me??? Here is my code:
---------begin code snipit-----------------
<Fields>
<asp:BoundField DataField="fldAlbumID" HeaderText="Index"
ReadOnly="true" />

......
<asp:TemplateField HeaderText="Album Release Notes"
HeaderStyle-VerticalAlign="top" ConvertEmptyStringToNull="false">

<EditItemTemplate>
<asp:TextBox runat="server" ID="fldAlbumReleaseNotes"
AutoPostBack="true" TextMode="MultiLine" Text='<%#
Replace(Eval("fldAlbumReleaseNotes"),"<br/>",vBCrlF) %>' Height="200"
Width="400" />

</EditItemTemplate>
</asp:TemplateField>
.....
</Fields>
<UpdateParameters>
......

<asp:parameters name="FldAlbumRelaseNotes" type="string" />
.....
</UpdateParameter>
-------------end code snipit--------------
How do you link this text box to a data field or just how do you get
the data from this field into the newfields database? Any ideas?

Feb 7 '07 #1
1 2226
dani,

I think your problem is that Eval() is for one-way binding. For two-way
binding you need to use the Bind() method.

see:
http://msdn2.microsoft.com/en-us/lib...66(VS.80).aspx

Hope this helps,
Jason Vermillion

"da**@funkervogt.com" wrote:
Hi Everyone,

I wanted to create a large text box (a textarea) for displaying some
large information for editing. I am using a DetailsView control with
an SQL data source, but every time I try to update my custom textbox
field it doesn't save to the database. I have done extensive testing /
researching and have found that this asp:textbox is not even in
the )OldItems or NewItems arrays of information. Can someone please
help me??? Here is my code:
---------begin code snipit-----------------
<Fields>
<asp:BoundField DataField="fldAlbumID" HeaderText="Index"
ReadOnly="true" />

......
<asp:TemplateField HeaderText="Album Release Notes"
HeaderStyle-VerticalAlign="top" ConvertEmptyStringToNull="false">

<EditItemTemplate>
<asp:TextBox runat="server" ID="fldAlbumReleaseNotes"
AutoPostBack="true" TextMode="MultiLine" Text='<%#
Replace(Eval("fldAlbumReleaseNotes"),"<br/>",vBCrlF) %>' Height="200"
Width="400" />

</EditItemTemplate>
</asp:TemplateField>
.....
</Fields>
<UpdateParameters>
......

<asp:parameters name="FldAlbumRelaseNotes" type="string" />
.....
</UpdateParameter>
-------------end code snipit--------------
How do you link this text box to a data field or just how do you get
the data from this field into the newfields database? Any ideas?

Feb 8 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: rkbnair | last post by:
I have defined <ItemTemplate>XXXX</ItemTemplate> and <EditItemTemplate>XXXX</EditItemTemplate> in an asp page. How can I make the EditItemTemplate item visible (I mean through the program)
6
by: tfsmag | last post by:
I have a Grid that I've set up to have two of the fields use dropdownlists while in edit mode. Now I can bind the data to the dropdownlists just fine. My problem is that the second dropdown depends...
2
by: WT | last post by:
Hello, I can figure how to set selectIndex or Value, I have tried this <EditItemTemplate> <asp:DropdownList ID="DDLSector3" DataSource='<%#...
2
by: John Smith | last post by:
I have this DataGrid: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="SM"> <ItemTemplate> <asp:Label id="Label2" runat="server"...
2
by: John Smith | last post by:
I have this DataGrid: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="SM"> <ItemTemplate> <asp:Label id="Label2" runat="server"...
2
by: clickon | last post by:
I am confused about the way in which asp:table objects work. When a control is within an asp table it generally appears to be in the scope of the tables parent control. E.g. if i have a page that...
23
by: tanya2001 | last post by:
hi all.. I am trying to update my datagrid in my webform...but its not getting updated..though in the database it removing the <null> and inserting a blank field....its not taking the input which m...
1
by: Jim in Arizona | last post by:
On one page I have a datalist where a message is bound to a label. On another page I have the datalist which allows for the insert of new message as well as being able to edit those messages. The...
4
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update the field on the form. It works fine when the field...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.