Search code examples
c#asp.netdetailsview

Can I use the DetailsView control without binding?


I wanna use the DetailsView control without binding it with a datasource (just in insert mode) but the problem is when I try to get the values of the fields throught ItemInserting event handler I found the e.Values property empty however there are some fields.

Note: I wanna use it (The DetailsView control) [instead of allign the fields manually] because there're already a theme for it in whole the system and I don't want to do that again from scratch for custom template.

Any Idea !!


Solution

  • Ah yes, I wrote a blog post on this topic. http://weblogs.asp.net/davidfowler/archive/2008/12/12/getting-your-data-out-of-the-data-controls.aspx.

    BTW in .NET 4.0 e.Values won't be empty :).