I am using User Controls in ASP.NET and C# to develop pages for my project. With these pages, I have formatted a bunch of CSS into a DetailsView. However, when I run an “Edit” CommandField, the CSS on the page changes a bunch and I don’t know how to stop it (ie. Text all becomes bold, column height changes dramatically, etc.). I don’t want to have to reset these properties every time this button is hit.
Is there anyway to prevent the CSS changes from occurring?
on your asp:detailview you can add different cssclasses bound to the type of action in the detailview. You can, for instance, use the
EditRowStyle-CssClassfor when you’re editing and use a different class forInsertRowStyle-CssClass.