As mentioned in the previous post, I've embarked on rebuilding DVDFreind.US for the 19th time. This time around, I'm using it as an opportunity to become more familiar with all of the controls built into ASP.NET.
I've been using ASP.NET for years, but I don't use a lot of controls. For the most part, I'm a middle-tier and database guy; I have very little interest in the presentation layer. I generally just drop a grid on the page, then manually bind it in the code behind.
The last time I worked on DVDFriend, I played with some things like the repeater. However, I couldn't get it to work just the way I wanted, so I revereted to building it manually. But, the attempt was a step in the right direction.
The main page of the new site is using the repeater control to render the recent blog list. This time around, it worked very well, and I'm comfortable with the architecture. ASP.NET would allow me to very simply bind the repeater to a SQL query. But that's bad design. I wouldn't do that unless it was a throwaway page, or if I temporarily lost my ethics. That's just not good design. However, ASP.NET allows you to use an Object Data Source. I bind my repeater to the object data source. The ODS calls a method in by my business object, which uses the DAL to get the data. All the layers are separated, so I'm happy.
I also learned a lot about the login controls. Good stuff. I've always coded this stuff manually. I see now that was a mistake and a waste of time. I've been using the login control since its invention, but I hadn't used the other related controls.
I usually have a link that either says "Login" or "Logout" depending on your current state. I've always manually created this, but today I learned it comes with ASP.NET. I just dropped the control in the header, and I was done. Ignorance wasn't bliss.
Coincidentally, recently at work we wanted to modify the login control and reposition the Forgot Password link. I didn't work on this item, but it was put on hold because there wasn't a control property to control that. Since I was I was playing with the control anyway, I looked into that problem. The solution was easy : convert the control to a template, then reformat it any way you want.
Going through this stuff took some time, but it was worthwhile. I'm learning all of the things that seasoned page developers take for granted. I'm making a point of using the controls rather than follow my instincts and code it all manually. I'll continue to use the controls wherever possible.
Sunday, June 24, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment