I am having trouble figuring out how to include Hidden Field or a TextBox
value when I am editing in the FormView Edit Item Template into the Update
Query. They are both located in the EditItemTemplate of the Formview. The
value is grabbed using a function
<asp:TextBox ID="LastUpdatedDate" runat="server" Text='<%# GetDateAndTime
'></asp:TextBox><br />
Public Function GetDateAndTime() As Date
Return Now()
End Function
I also have in the page
<asp:Parameter Name="LastUpdatedDate" Type="DateTime" />
And the Update Query includes
[LastUpdatedDate] = @LastUpdatedDate
But the LastUpdated Field becomes NULL
If I could figure out how to do that, it would solve alot of problems. Ive
tried to do this about 3 times without any luck
In an attempt to find a work around I was going to grab the ITEM_ID Number,
using Response.Form
Response.Write("ID Number = " & Request.Form("ITEM_ID"))
Then reinsert Now() as LastUpdatedDate
How can you address values that are posted back using the Formview object
Thanks for your help.
Wayne
Enigma Boy - 06 Aug 2007 08:14 GMT
Thats because you are not doing a two way databind.
In the datasource updating event do a formview.findcontrol on the text box.
and pass the value to e.NewValues

Signature
<a href="http://1pakistangifts.com">Send Gifts to Pakisan at #Pakistan Gifts
Store</a> | <a href="http://dotspecialists.com">Leading Software offshoring
and outsourcing service provider</a> | <a
href="http://websitedesignersrus.com">Professional Websites at affordable
prices</a>
>I am having trouble figuring out how to include Hidden Field or a TextBox
>value when I am editing in the FormView Edit Item Template into the Update
[quoted text clipped - 33 lines]
>
> Wayne