We needed to pass some extra information on one web page.
That information was part of a column in a GridView and should have been available to client side script but not rendered. We could not set the Visible property of that column to false. That would not have solved the problem because anything that is not visible isn’t even rendered by ASP.Net to the client.
We thought and we thought like we do in situations like this. Eventually, one trick came to my mind, just like the illumination that ’64 S on a C B’ means 64 squares on a chess board. I told the developer to use a template column, add a HiddenField as ItemTemplate and EditItemTemplate for that column, set the Value property to the information we needed to pass and voila! Problem was solved with only a three pixel wide column displayed. To make that even less noticable, we set the boder style for that column to Transparent, BorderWidth to 0px and even those little horizontal lines were gone.