WorldofASP.NET : ASP.NET Directory, Tutorial, Hosting, and Source Code
You are 1 of 219 users


ASP.NET MVC Tip #32 – Repopulate Form Fields with ViewData.Eval()

Blogger : ASP.NET Team Blogs
All posts : All posts by ASP.NET Team Blogs
Category : ASP.NET
Blogged date : 2008 Aug 13

When you need to repopulate the form data in an edit form, displaying both valid and invalid values, use ViewData.Eval() to retrieve the values from both the view data dictionary and the view data Model. You use view data in an ASP.NET MVC application to pass data from a controller action to a view. You assign the view data to a controller’s ViewData property and you read the view data from a view’s ViewData property. The MVC ViewData class is a hybrid of two classes. On the one hand, the ViewData class inherits from the base Dictionary class (Dictionary<string,object>). Therefore, it works just like a standard generic Dictionary collection. You add a key and value pair to ViewData like this: ViewData[“message”...(read more)

Read comments or post a reply to : ASP.NET MVC Tip #32 – Repopulate Form Fields with ViewData.Eval()
Page 332 of 1924
Next | Last

.NET News Categories








Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 | Link To Us | Contact Us
© 2002-2008 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | Windows Web Hosting | ASP.NET Hosting | Phone Card | PHP Directory | Bangkok Hotels |Calling Card