Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ItemUpdating using DataSource(FormView or DetailsView)

Reply
Thread Tools

ItemUpdating using DataSource(FormView or DetailsView)

 
 
=?Utf-8?B?Y2lzY28=?=
Guest
Posts: n/a
 
      05-22-2006

I've been trying to figure out how the client of a DetailsView or
FormView should handle the ItemUpdating event when setting the datasource
programatically. I want to do something simple like this:

formView.DataSource = new SomeUserObject[] { user };
formView.DataBind();

All the examples i've come across show a declerative data source being
used. Do i need to use ObjectDataSource? I can get the information going
through the cells by parsing the html but that smells funny.

the FormViewUpdateEventArgs always has the OldValues and NewValues
collection empty.(Keys is too). ModeChanging behaves differently when setting
the data source explicitly(documented in the docs) but i can't find anything
for the ItemUpdating event.

I can't seem to get the edited values. I feel i'm missing something simple
but i'm just not sure what! Maybe somehow i need to populate the NewValues
and OldValues myself?


 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      05-23-2006
Hi,

Thank you for posting!

Yes, you need to use ObjectDataSource here to take full advantage of
ASP.NET 2.0's powerful Data Binding features.

You can learn more information about DataSource controls from following
articles:

#DataSource Controls and Declarative Programming
http://www.nikhilk.net/DataSourceControlThoughts.aspx

#Data Points: Data Source Controls in ASP.NET 2.0
http://msdn.microsoft.com/msdnmag/is...01/DataPoints/


Regards,
Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formview itemupdating not updating textbox value Nic ASP .Net 0 09-11-2009 02:24 PM
ListView ItemUpdating OldValues and NewValues collections Empty (linqDataSource) Marius Manolea ASP .Net 0 06-04-2008 04:40 PM
FormView ItemUpdating event and empty NewValues... Łukasz Ledóchowski ASP .Net 0 01-01-2008 10:45 PM
DetailsView ItemUpdating woes... Timothy H. Schilbach ASP .Net 1 10-25-2006 09:52 PM
Null Values in ItemUpdating Event =?Utf-8?B?Y2xpY2tvbg==?= ASP .Net 3 05-25-2006 02:49 PM



Advertisments