views:

129

answers:

1

When in Insert Mode or Edit Mode of DetailsView, the default behavior of click CancelButton is clear inputs in TextBox. But I just want to redirect to other pages instead of clear inputs. I hope there is server side event triggered so I can Response.Redirect.

Client side (some JS?) redirect is fine too.

+1  A: 

Check out the ModeChanging Event and CancelingEdit Property.

void DetailsView_ModeChanging(Object sender, DetailsViewModeEventArgs e)
{
    if (e.NewMode == DetailsViewMode.Edit ||
        e.NewMode == DetailsViewMode.Insert)
    {
        if (e.CancelingEdit)
        {
            //canceled
        }
    }
}
Phaedrus