FormView control in ASP.NET 2.0

C

Craig

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top