« Stock Photos provided? | ^ Main | Flex Builder 2 Beta 2 on Windows Vista »
First ASP.Net Site
This is the first post in the .Net category for this blog. I created this category since C# doesn’t quite cover the spectrum of .Net in terms of all it can do. So, this category will be for .Net specifc and C# will be for C#.
With that said, I created my first ASP.Net site today. I did it just to toy around and test some of the stuff I’ve seen (at Mix) and read in my book(s)/online. There are several things that were kind of odd to me but in the grand scheme of things…WOW. Let me list likes and dislikes.
- Visual Studio validates (automatically I might add) XHTML 1.0. This is good and bad because it keeps telling me “Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.” This is annoying because the controls added to the page (via drag-n-drop) all use ID vs id. Not a big problem but still annoying.
- Web.sitemap is thoroughly sweet. It was terribly annoying at first though. You have to place a root siteMap node with one and only one childe siteMapNode inside. I know you are wondering like me…how do you get multiple pages in your navigation, etc? Inside the first siteMapNode you add all of your child nodes. Those nodes will serve as your main navigation if you set your SiteMapDataSource attribute ShowStartingNode to false. It took some searching for me to find that tidbit.
- Page menus are horribly simple. You can bind the control to a datasource (in my case a SiteMapDataSource) and do nothing else but style it. You have pretty thorough control over the styles as well. My problem with prebuilt controls/components (outside of .Net) is the styling. You can get certain things done but not others. It always has that “prebuilt” feel to it. Well, ASP.Net is not in that same category. You have complete, so it seems, control over the style including rollovers, selected states, etc.
- I read and saw how easy it was to read from a database and KM had a web service project in which I toyed with the code quite and bit and saw a few thigns but I never did it myself. Today, I did.
- Drag a SQLDataSource on your page
- Specify the ConnectionString, ProviderName, and SelectCommand (just the basics here)
- Bind a control to your SQLDataSource ID.
- Somewhat continuing with the previous iem, binding a control to a datasource is quite easy. I toyed with the GridView and, as previously said, WOW! :-) I bind it to the table with DataSourceID=”MySQLDataSourceID” and the table was automatically generated from my database table. This was quite sweet. I could even specify alternating row colors, tons of styles, and best of all PAGING! KM just did a paging site in PHP (will post the URL when it launches) for a client and it wasn’t dreadful but it was irritating in some instances. How hard is it in PHP? Set AllowPaging=”true” and PageSize=”5”!!!!!!!! That’s all I needed to do. I could control the page size, position of paging navigation, type of paging navigation (numeric vs >>), and a slew of other paging attributes (including specific paging styles with image capability). Man! Oh, let’s not forget I added sorting just as easy. Bottom line…this control is very rich in abilities but allows you good control over styles.
I haven’t fully jumped into using a code-behind page but that is partially because I could do all of the above without writing one line of C#. I FORCED myself to write C# only because I wanted to try and create classes. That really was a square peg in a round hole. Not that I couldn’t but it wasn’t needed at all.
How long did it take me to create my initial version (custom navigation [not based on sitemap], GridView bound to a SQL database on our server, and paging/sorting integrated in GirdView)?
8 MINUTES!! (with 3 of them dedicated to figuring out options and toying with configuration options)
I still stand by ColdFusion being faster for maintenance, etc of a site but I’m not 100% sold on it being faster in all manners anymore. It would have taken me about 30 minutes (or less) to add paging/sorting and it probably wouldn’t have been as elegant (without letting an application create it for me or using Javascript). More to come as I continue to toy around.
Posted by John C. Bland II on April 2, 2006 10:48 AM | Permalink
TrackBack
TrackBack URL for this entry:
http://mt.katapultmedia.com/mt-tb.cgi/94



