DetailsView loses controls state and binding after an exception occurs
-
Hi. I'm using ASP.NET 2.0 and MS SQL Server 2005 environment. I'm developing an aspx page which is using DetailsView to insert data. There are several TemplateFields are located at the DetailsView control. These Template fields containing TextBox and DropDownlList controls and I'm passing values of these controls using %Bind% syntax: * DataSource for the DetailsView is the SqlDataSource which is using StoredProcedures to insert data into Database. Some parts of business logic are located in the T-SQL code of the StoredProcedure and in case of any error I'm throwing exception from T-SQL using RAISE_ERROR method. In the aspx.cs, OnItemInserted event of the DetailsView I've implemented following code for exception processing: protected void dvCity_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { if (e.Exception != null) throw e.Exception; else Response.Redirect("City.aspx"); } When there is no error during StoredProcedure execution everything is works fine. When my StoredProcedure r