Simon Mourier's Avatar
Simon Mourier's blog (1352 answers on StackOverflow) about Microsoft technologies C#, C/C++, .NET, WinRT, WinUI, COM, Interop, DirectX, Direct2D, Windows, ...
  • 🔎︎ Search
  • Categories
  • Archives
  • About Me
  • asp.net
  • visual-studio
  • web

ASP.NET closing tag

Sep 16, 2016 See the question and my original answer on StackOverflow

This is because ASP.NET's Label control is decorated with the ParseChildrenAttribute, with ParseChildren(false) while CheckBox isn't.

You can support the same behavior whith your custom controls, for example, with the following code, Visual Studio will behave like Label if you use MyControl in the web form editor:

[ParseChildren(false)]
public class MyControl : WebControl
{
    ...
}
  • SmoBlog © 2010-2025 Simon Mourier. All rights reserved.
  • Privacy & Terms