Blog Stats
  • Posts - 80
  • Articles - 1
  • Comments - 341
  • Trackbacks - 69

 

Long live ASP.NET, (please dont bloat ASP.NET)

I've realized that ASP.Net is getting BLOATED with lots of “RAD” tools, and making it harder and harder to do things “the ASP.NET way”  

I spend hours fighting with DataGrids and GridViews.  Sure they work great out of the box, but sometimes you gotta do things “outside the grid“, and thats when things get whacky... fast. 

For instance, last night I'm building a GridView with a set of strongly typed domain objects (via Wilson ORMapper; fantastic library).  The ObjectDataSource control just cant handle it.  So now I'm already hitting bare metal.  Over to the codebehind and add a couple lines:

GridView1.DataSource = quotedb.ObjectSpaceManager.GetObjectSet<QUOTEDB.SHOPPINGCARTDETAIL>(string.Format(“ShoppingCartID={0}“,shoppingCartId))
GridView1.DataBind()

Ok, great!  It works! Eureka!  but wait, I gotta pull the Description property from a child property from the ShoppingCartDetail instance, via ShoppingCartDetail.ProductObject.Description.   Bang!  GridView fails again.  I guess you can't say <asp:BoundField DataField="“ProductObject.Description“" />

Ouch, bare metal again... So more codebehind:

GridView1_RowDataBound(...) {
   if(e.Row.RowType == DataControlRowType.Item)
      e.Cells(1).Text = ((quotedb.ShoppingCartDetail)e.Row.DataItem).ProductObject.Description;

Refresh, and viola! Description!  Cool!  ...except its bold?  Hmmm thats bizarre.  “View Source...” and it begins rendering <TH> tags around the Description?  WTF?  So by this time I'm furious.  I've gotta REPLACE TEXT on the output html?!?!  Whats the point of all this?  Why does the GridView fail me everytime I step outside the box?  Yeah, its better than DataGrids... don't get me started!

This is after putting down a DIFFERENT problem on the same page trying to calculate SalesTax and stuff into a cookie for the checkout page. 

NOW ON THE OTHER HAND

Working with SqlDataSources and GridViews is a MAJOR improvement over DataGrids of 1.0 era.  Thank God for that!  Paging, sorting, and nifty client-side callbacks for Paging and Sorting... neat!  But this is directly accessing the database.  So its tied to my database schema very tightly.

Look the reason why I use .Net... Its a great platform over all.  Fantastic.  I cringe anytime I even think about code thats not managed.  C++?  You can have it.  Java... I'll pass.  Good start!  But Sun's is resisting some runtime “updates“, specifically generics.  (I know they'll have them, which is a start, but no perf improvements from the runtime since they just downgrade to object type anyways, with the same casting inefficiencies)

And ASP.Net's WebServices are fantastic.  Decoupling along with good contracts is a fantastic way to be able to manage code/database evolution.

GridView is almost there... leagues ahead of DataGrids, but still needs more “real world” like nested properties and so forth...


Feedback

# re: Long live ASP.NET, (please dont bloat ASP.NET)

Gravatar This is the single biggest drawback of any web-based grid control I've used. I'm surprised I don't see more complaints about this. My guess is that OR/M tools with their complex hierarchies are more susceptible to this limitation. For my part, I usually end up flattening the data, either on the DBMS or in a wrapper class, prior to binding. This is a shame because it adds needless complexity to the presentation layer.

9/1/2005 8:08 AM | Matthew Vandergrift

# re: Long live ASP.NET, (please dont bloat ASP.NET)

Gravatar ObjectDataSource drives me nuts, its really no good if you can't databind to nested properties, I prototyped all the .NET controls and added an UnbindToProperty property to specify a property of a given object to unbind to, UnbindingHelper and FormUnbinder class, works quite well and does not restrict me to the funny world of business objects ObjectDataSource is aimed at. 2/1/2006 10:30 AM | Fluxtah

# re: Long live ASP.NET, (please dont bloat ASP.NET)

Gravatar Agreed, coming from a Java background and using libraries like DisplayTag, the first thing I tried to do after adding a GridView was access a nested property using "DataField="“ProductObject.Description“". A little free Java library can do it but Microsoft can't build it into their Gridview?

Weak.

I enjoyed your post. 1/11/2008 1:21 PM | Joe

# re: Long live ASP.NET, (please dont bloat ASP.NET)

Gravatar Try using templated columns.
You can avoid all the reflection stuff that goes on under the hood with the "DataField". They more flexible down the track too.

btw SqlDataSources are the worst thing ever to happen to asp.net. They discredit anyone using the platform. 11/18/2008 4:43 PM | En

# Всем фанатам

Gravatar Скажите а материалы с Вашего сайта можно у себя размещать? 5/25/2009 2:22 PM | broarmAllebra

# Новый сайт бизнес новостей

Gravatar Будем ждать продолжения статьи 5/26/2009 12:19 PM | Unelsonge

# Новый спортивный сайт

Gravatar Хочу у себя на сайте что-то подобное сделать 5/26/2009 4:25 PM | proomsGessy

# Все о спорте

Gravatar Интересная информация у вас на сайте 5/27/2009 7:23 PM | oriellura

# Ну не интересно мне

Gravatar Сразу видно когда автор знает о чем пишетю Молодец! 5/29/2009 2:59 PM | vladrfio

# Новый портал бизнес информации

Gravatar А как на вашу рсс-ленту подписаться? что то не пойму 6/1/2009 11:51 AM | Sernjaire

# Мастер спорта

Gravatar Да это действитеьно интересно, будем ждать продолжения 6/7/2009 8:11 AM | choireeinfecy

# Все научные факты - ngfdgfdfg d- f у нас

Gravatar Новая смена полярников, вылетевшая 5 февраля из Санкт-Петербурга в южноафриканский Кейптаун, привезет с собой в Антарктиду спецконтейнер с комплектом “экологически чистой бани из клееного бруса с замкнутым циклом обеспечения”, сообщает сайт Все научные факты
Сорок два полярника, припасы, научное оборудование и баню на прибрежную антарктическую станцию “Новолазаревская” привезет флагман полярного флота “Академик Федоров”.
Планируется, что “банный комплекс” будет построен на специально подготовленном участке вблизи одного из антарктических озер. 6/7/2009 10:56 AM | Chaibiafepe

# Все для бизнесмена

Gravatar Действительно интересно написано. Добавил в избранное, буду заходить почаще. 6/8/2009 12:40 PM | shergesor

# Журнал спортивных новостей

Gravatar Бывший вратарь сборной Германии по футболу Йенс Леманн прилетел на одну из тренировок своего клуба “Штутгарт” на вертолете, заплатив за перелет тысячу евро. Голкипер проживает в 250 километрах от тренировочной базы команды, расположенной в городе Берг (неподалеку от Штутгарта), сообщает Журнал спортивных новостей. Фотографии Леманна, выходящего из вертолета, появились 19 сентября в немецких газетах. Мэр Берга Руперт Манн рассказал, что он получил несколько жалоб от жителей города, и пообещал поговорить с футболистом, если он вновь прилетит на тренировку на вертолете. В Берге проживают около 8200 человек. 6/8/2009 4:14 PM | BemnSheeduh

# Музыкальный обзор

Gravatar Надеюсь ваш сайт будет дальше развиваться 6/9/2009 10:11 AM | AttighhaT

# whitebiznes

Gravatar
Хотел бы узнать по поводу вашего домена Продаестя ли домен, и если да, то прошу отвветить мне на почту, а также отписаться в комментарияфх - вдругн спам фильтр не пропустит.
лудшие продукты 6/11/2009 3:15 AM | Edibscossette

# re: Long live ASP.NET, (please dont bloat ASP.NET)

Gravatar I love Asp.net and use it. It's cool! 6/14/2009 3:29 PM | dinter

# Новый сайт о расниводстве

Gravatar Дизайн у Вас интересный, я вот тоже для блога искал - стала прикручивать, а все посты куда то делись. Эээх... буду писать заново 6/15/2009 12:29 PM | PymnScoobby

# Доступно о бизнесе

Gravatar Что то у Вас дизайн косит, сижу под ИЕ 6/23/2009 3:31 AM | nessalficle

# Савва

Gravatar Даа: По-моему, минусы намного превосходят плюсы. Думаю, не стоит заморачиваться. 6/30/2009 3:59 AM | Кирилл

# система ниппель

Gravatar слово "жопа" 7/9/2009 4:42 AM | labumbox

Post a comment





 

 

 

Copyright © Eric Newton