Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. DetailsView loses controls state and binding after an exception occurs

DetailsView loses controls state and binding after an exception occurs

Scheduled Pinned Locked Moved ASP.NET
databasecsharpasp-netsql-serverwpf
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex Getman
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups