By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,456 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,456 IT Pros & Developers. It's quick & easy.

ItemUpdating using DataSource(FormView or DetailsView)

P: n/a

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?
May 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.

May 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.