DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 2 Aug 2007 15:23:30 -0500,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Wayne
          2    Enigma Boy


Formview and external data   
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
Date:Thu, 2 Aug 2007 15:23:30 -0500   Author:  

Re: Formview and external data   
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

-- 
<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>
"Wayne"  wrote in message 
news:newscache$hgx5mj$syk$1@dada.knx.tva.gov...

>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
>
> 
Date:Mon, 6 Aug 2007 12:14:14 +0500   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us