Following on from my last post on ASP.Net, here are some more:
- When you define a FormView control without a header or footer template, you still incur the cost of the header and footer in ViewState. Yes - the FormView dev created table rows for the header and footer, added them to the Controls collection and set them to invisible prior to the SaveViewState phase - meaning you get an extra 48 bytes (according to trace.axd) of overhead for no reason.
- Page_Load, Page_Unload etc ignore ConditionalAttribute applied to them. (Or rather the ASP.Net event hookup framework ignores ConditionalAttribute)
- Why doesn't the GridView have a TotalRowCount property? By default GridView uses a dataset and knows how to page. Indeed, a FormView has something similar to enable you to get the Total row count. But a GridView doesn't.
- Using the rowstyle wrap attribute like <asp:gridview><rowstyle wrap="false"/></asp:gridview> does not work in IE. You have to set every column individually.
- The onClientClick event is broken - the databinding expression has to be at the start of the string. eg: have a look at what gets rendered for the following: <asp:button runat="server" Text=" <%#Container.DataItem %>" onclientclick=' <%#Container.DataItem %>)'/>. Notice how the text/value is fine, but the onclientclick/onclick is a mess. Then when you try to put quotes inside of the event (for example a Javascript Confirm() ), ASP.Net just doesn't allow this scenario. eg onclientclick='<%# "confirm('" + Container.DataItem + "')" %>'. The only workaround I could think of was to set an expando attribute to the databound expression, then refer to that attribute from Javascript on the client side...
I'd like to re-iterate that I really like ASP.Net, especially v2. I just can't wait for that Q3 2006 service pack.
Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using