views:

96

answers:

1

I have a DetailsView with several fields. On the same page, I have both LinkButton that enables to go in edit or insert mode for the DetailsView.

When I click on a button, linked code-behind is doing the following :

    switch (buttonCmd.ID)
    {
        case "cmdEdit":
            DetailsView1.ChangeMode(DetailsViewMode.Edit);
            break;

        case "cmdInsert":
            DetailsView1.ChangeMode(DetailsViewMode.Insert);
            break;

This kind is working fine in another page from the site website but not on this one... Probably a bad copy-paste...

Any idea that could explain why DetailsView is displayed twice ?

A: 

Clear the datasource of the detailsView before re-binding after Edit/ Insert operation.

HotTester
It does not explain my issue but at least it's a good work-around. Thanks.
Sylvain