Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 4th, 2010, 03:42 PM
Authorized User
 
Join Date: Jun 2010
Posts: 24
Thanks: 10
Thanked 0 Times in 0 Posts
Default

Man, you're king of the hill!!! It works!!!

Now I'll try to work the update date!!

Thanks so far!!

Groeten uit Sneek!!
 
Old November 4th, 2010, 05:18 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome....

Updating is slightly more difficult. You have a few options, including:

1. Handle an Updating event as shown in the book. This is relatively easy.

2. Hook into the SavingChanges of the ObjectContext, find the entity being updated, check if its of the type you're expecting and then set the UpdateDateTime.

The process is explained here: http://msdn.microsoft.com/en-us/libr...ngchanges.aspx

That example doesn't update a property, but validates data, but the concept is the same. At the location where the validation takes place, you could assign the date and time to your property.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.