I would like to change the default method of inserting data to make it use a stored procedure, plus I would like to get a return value from this stored procedure returned to the calling code.
Scenario is that on insert the default behaviour is to go to the list view, but I would like to get from the insert the autogenerated primary key and use this to re-direct to a different form showing the newly inserted record.
I see that I can create a partial class for the DataContext class and then create my own InsertTable method which will be called on the insert action, but this is a sub so it is not clear how to return a value to the Insert.aspx code behind class for processing.
I can override the DetailsView ItemInserting method, but to use this I would need to set the cancel property to true to prevent double insertion, and then the validation behaviour does not work.
So how would this be done?
Thanks