Blog Home  Home Feed your aggregator (RSS 2.0)  
DataSourceControls… Non visual controls? - Manuel Abadia's ASP.NET stuff
 
# Wednesday, June 7, 2006

When I started learning ASP.NET 2.0 I noticed that the component tray was taken out of the designer and somewhat the concept of component (in ASP.NET 1.x) was obsolete and did not apply in ASP.NET 2.0.

I was very angry with the new direction taken about this when I found this post by Nikhil Kothari’s (an ASP.NET dev. team member):

http://www.nikhilk.net/NonVisualControlsAndComponents.aspx

that explains some of the problems found when implementing the new data source controls in asp.net 2.0. Even they do not render any mark-up, they need to participate in the page life cycle, so the old concept of component and the old model of persisting components in the code behind file wasn’t working for this. Anyway, I had the idea that data source controls should not appear with the rest of the controls in the page and I didn’t liked the current implementation that shows the data source controls located anywhere on the page.

Some months later, I have changed my mind and I have to congratulate Microsoft for this decision. IMHO, the best is to have an attribute that lets the designer know which control produces html output and which one doesn’t. That way the developer has the final decision and the designer doesn’t restrict developer’s imagination.

For example, I was converting to ASP.NET 2.0 an old pager I have been using in a lot of projects but when I was doing the conversion I thought: a pager has user interface but also is a data source for another control… hmm

I rewrote the control from scratch in order to see if I can come up with a pager that can act as a data source control, and finally, after sorting out very subtle problems and complex relationships with the binding infrastructure and data source controls I finally had something working. I’m very impressed with what I obtained because I was able to add paging to a control with no code at all thanks to the magic of the data source controls! I think this was a very good idea so I worked hard on making my pager a fully customizable control with a lot of features like page links that are search engine friendly and full design time support for interacting with data source controls:


I made a sample web site that shows some scenarios with the different features of the PagerDataSource and also redesigned the main website (let me know what you think about the new design). There is an evaluation version if you want to try it.

PagerDataSource Live demo: http://www.manuelabadia.com/livedemo/pagerdatasource
Main site: http://www.manuelabadia.com/

I hope you find the control useful…

Wednesday, June 7, 2006 5:33:18 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2]   ASP.NET  |  Tracked by:
"DataSourceControls summary" (Manuel Abadia's ASP.NET stuff) [Trackback]
http://www.manuelabadia.com/blog/PermaLink,guid,7cef4a16-10ec-44e5-8f3c-36a977b8... [Pingback]
Thursday, June 8, 2006 12:51:20 AM (Romance Daylight Time, UTC+02:00)
Excellent work! A couple ideas:

1) How about "letter-page" style that lets you do the classic roladex pager where you get one "page" link for each leading-letter. This would, of course, result in pages that have more or less rows and we should be able to return the "letter-list" from another DataSource so it is nice an dynamic and localization-friendly.

2) Another way to handle the spider-friendly links is to have them generated as-if autopostback is turned off, then inject some client-side JavaScript that turns them back into normal _doPostBack calls. This works because the spider won't run the JavaScript so it'll get the undoctored page.

3) Are you going to offer a bundled price with EODS and this (I'm creeping closer toward purchase).
Thursday, June 8, 2006 6:29:06 AM (Romance Daylight Time, UTC+02:00)
Marc,

Regarding your first point, I thought about adding some functionality like that but ran out of time. I have to think more about it to see if I can add it to the PagerDataSource or it is better to add another control to the PagerDataSource package in the future.

Regarding the second point... it is brilliant! I didn't think about that solution but definitely it is worth adding to a future revision of the control.

Use the contact form and tell me if you want the binary version or the source code version and I'll send you a 10% discount coupon.

Thank you very much for the feedback.
All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

[Captcha]Enter the code shown (prevents robots):

Live Comment Preview
Copyright © 2020 Manuel Abadia. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.