You can have your own custom control that renders either a child Label or TextBox based on some property, but there's no native control to do either/or.
Within a DataGrid or other tempated control, you can also tweak the item templates to conditionally show Labels or Textboxes.
You'd want to add a PlaceHolder control to the spot you want to conditionally display the TextBox/Label, then conditionally add either to the PlaceHolder's child controls in Page_Load.
While I'm thinking about it, another popular (though less efficient) alternative is to add a TextBox and Label side-by-side then set the visibility of the controls conditionally.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.