FormView control in ASP.NET 2.0

Discussion in 'ASP .Net Web Controls' started by Craig, Dec 27, 2005.

  1. Craig

    Craig Guest

    I am using the form view control in ASP.NET 2.0.
    I am in the edit mode
    I enter an alpha character in a numeric field
    Click update and the event below traps and and handles the error.

    The problem is the value for the textbox gets reset back to the original
    value, I want it to stay until the user correcrs it. How do I do this??

    Thanks



    Protected Sub FormView1_ItemUpdated(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.FormViewUpdatedEventArgs) Handles
    FormView1.ItemUpdated
    'Trap Errors here

    If e.Exception Is Nothing Then
    Session("MessageText") = "Updated Successfully"
    Else
    'Display friendly message to end user and techy user to me
    locally
    If HttpContext.Current.Request.UserHostAddress = "127.0.0.1"
    Then
    Session("MessageText") = e.Exception.Message
    Else
    Session("MessageText") = "Error processing page."
    End If

    e.ExceptionHandled = True
    End If

    End Sub
     
    Craig, Dec 27, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pete
    Replies:
    1
    Views:
    1,276
    Kivak
    Jun 27, 2005
  2. sck10
    Replies:
    3
    Views:
    8,172
    Steven Cheng[MSFT]
    May 1, 2006
  3. Dan Sikorsky
    Replies:
    1
    Views:
    3,974
    Brock Allen
    Jun 17, 2006
  4. Chris

    Formview within Formview

    Chris, May 19, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    545
    Chris
    May 19, 2007
  5. David Thielen

    FormView/Repeater/ Eval(FormView data)

    David Thielen, Jun 16, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    657
    David Thielen
    Jun 16, 2006
Loading...

Share This Page