Tech Off Post

Single Post Permalink

View Thread: string.empty and  
  • User profile image

    There are many things you have to remember about asp web controls. Two of them are:

    1. When your code runs on the server side, it is seeing the ASP control, not the HTML control that ends up on the page.

    2. ASP controls do not map in a one to one fashion to HTML controls. ASP has to build them out of one or more HTML controls and manipulate their contents to fit the control.

    In this case, #1 means that you are looking at an abstraction that will later be rendered into HTML. #2 means that when a asp:DataGrid is turned into an HTML TABLE, empty cells cannot be left empty or they will not be displayed properly. To deal with this, they are 'filled' with a non-breaking-space.