Link to home
Start Free TrialLog in
Avatar of IUFITS
IUFITS

asked on

Form View Firing Update Event in C#

I've inherited a C# ASP.NET web application and I'm trying to add 5 fields onto a FormView.  One of the fields (in a text box) I want to strip out certain characters on when the form view is submitted.  I tried to use the below event (disregard the confusing naming):

    protected void DetailView_ItemUpdating(Object sender, FormViewUpdateEventArgs e)

The problem is, this event never seems to fire.  In the FormView tag I added the OnItemUpdating="DetailView_ItemUpdating" and even tried adding the below to the Page_Load event:

DetailView.ItemUpdating += new EventHandler(DetailView_ItemUpdating);

I've traditionally used VB.Net as my code behind and never experienced issues wiring up these events.  Where am I going wrong trying to get this event to fire or where would be a better place to update the value of that item before it's committed to the database?
ASKER CERTIFIED SOLUTION
Avatar of TSmooth
TSmooth

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IUFITS
IUFITS

ASKER

It's using the Update button that's provided on the form view.
Can you paste aspx code within the "EditItemTemplate" of the form view that includes the update button? If it's a lot of code, filter out the irrelevant pieces.