I have a formview. With the datasource of the formview i want to insert a record into the database, but i want to insert a value i get from a method i create in code. Doesn’t that mean that i will not be able to directly code this onto the Data source using the wizard?
Share
I don’t think you can get the value directly from the method, but you can get dynamic values from:
(See here for details ==> http://msdn.microsoft.com/en-us/library/xt50s8kz.aspx)
You could put the result of your method into one of these (i.e. hidden form field or Session for example) and still use the DataSource wizard to set it all up.
If this doesn’t work for you, it’s fairly easy to inject dynamic values into your inserts via the ItemInserting event of the FormView control.