Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Formview and external data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wayne - 02 Aug 2007 21:23 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.