Great Lesson! I would add that some "understanding" could be leveraged around what is being done in setting viewstate to false in the GridView and why the "percent pound" is used in the codeblock vs. percent equals.
First - GridViews save the grid in the viewstate. They also use the viewstate to auto-generate comumns. Setting EnableViewState and AutoGenerateColumns to "false" lets you control the column data manually via the Columns tags. This allows manual control.
Second - When to use "percent pound" vs. "percent equals" Here "percent pound" is the same as "percent hash" or "percent sharp":
• The <%= (equal) expressions are evaluated at render time.
• The <%# (pound) expressions are evaluated at DataBind() time and are not evaluated at all if DataBind() is not called.
• <%# (pound) expressions can be used as properties in server-side controls. <%= (equal) expressions cannot.
rheitzler 6 months ago
Great Lesson! I would add that some "understanding" could be leveraged around what is being done in setting viewstate to false in the GridView and why the "percent pound" is used in the codeblock vs. percent equals.
First - GridViews save the grid in the viewstate. They also use the viewstate to auto-generate comumns. Setting EnableViewState and AutoGenerateColumns to "false" lets you control the column data manually via the Columns tags. This allows manual control.
rheitzler 6 months ago