How ASP.NET CommandName and CommandArgument values are stored?
.net, asp.net, c#, viewstate
Solution
If you want to understand ASP.NET internals, I still think the best book is Developing ASP.NET Server Controls and Components by Nikhil Kothari and Vandana Datye. It's written for .NET 1.x, so a bit dated, but still covers the basic architecture really well.
In your example, the reason ViewState size is not affected is that ViewState is not being tracked during the Init phase when the markup is processed. Property values set to fixed values in the markup will be hardwired in the code generated when the ASP.NET page is compiled.
This MSDN article gives a good overview of ViewState.
You will see ViewState growing if you put the buttons in a data-bound control such as a repeater or GridView, and use data-binding syntax to have different values for the CommandArgument for each row.
Problem
Does anyone know where CommandName and CommandArgument properties of controls are stored? I am not interested in retrieving them, just to know more about ASP.NET internals and for future page size considerations. :) I created a simple page containing 3 buttons having their commandArg and CommandName set as follows: ``` <asp:Button Text="Click1" runat="server" CommandArgument="1" CommandName="Delete" OnCommand="CommandExec" /> <asp:Button Text="Click2" runat="server" CommandArgument="2" CommandName="Save" OnCommand="CommandExec" /> <asp:Button Text="Click3" runat="server" CommandArgument="3" CommandName="Copy" OnCommand="CommandExec" /> ``` changing CommandArgument or CommandName to a considerably large values do not affect ViewState content and size, so where these values are stored? thanx