load page with detailsview in insert mode

2019-07-15 12:06发布

问题:

I have an ASP.Net page with a gridview and detailsview...when I click an item in the gridview, the detailsview is displayed and populated with the details of the selected user from the gridview....currently, when I first load the page and no user is selected from the gridview, I don't see the detailsview...how can I display the detailsview in insert mode when the page is loaded...before a user has been selected from the gridview?

回答1:

DetailsView1.DefaultMode = DetailsViewMode.Insert;