Archives

Archives / 2003 / October
  • ASP.NET v2.0: Miscellaneous Cool Features

    ASP.NET v2.0 makes it easy to set focus and defaul buttons, as well as maintain your scroll positions across postbacks.  Its easy to setup a site map so navigational menus, trees, and breadcrumbs are all based on this one store.  Client-side callbacks that allow you to minimize postbacks are really cool, as is the creation of a separate ControlState (from ViewState) for essential properties.  Of course, it goes without say that I like MasterPages, as well as Themes and Skins.  I also like the Code and Resources directories, and you can even specify additional code directories to automatically compile.  Finally, VS.NET actually does not alter your html, and it actually will even supply some more control of how it alters it if you want it to do so at all in the first place.

  • ASP.NET v2.0: Posting to Other Pages is too Limited

    I'm definitely excited about ASP.NET v2.0 and all the new features it brings, so its hard to criticize it in most cases.  However, one problem I have is with the current implementation of posting to other pages.  As most ASP.NET developers know, your server-form is limited to posting back to itself in ASP.NET v1.*.  This behavior will change in ASP.NET v2.0 with a feature called cross-page posting.  Basically, each button (and other relevant controls) have a postTargetUrl property.  This property allows you to specify where that control will cause the page to be posted to.  This is great in most cases since it allows the post target to be changed on a case-by-case basis, while keeping the rest of the form to still post back to itself.  The problem is that the  current implementation forces this url to be a page in the same application!

  • ASP.NET v2.0: New Web.Config Options in Whidbey

    There are lots of new options in the web.config file in ASP.NET v2.0.  I particularly like ability to globally define your RegisterTagPrefixes, as well as your Imports for all of your Pages.  Its also nice to see the cookieless attribute for Forms Authentication, with more options then just true or false so that different devices are handled appropriately.  Many of these others are very complicated, and they'll be discussed in articles about the specific features.  Here's the general layout:

  • ASP.NET v2.0: ObjectDataSource and ObjectSpaces

    ASP.NET v2.0 has several datasource controls that allow you to declare all of your database access code when using the new GridView and other controls.  One of the coolest versions of this is the ObjectDataSource control which lets you easily declare the name of a class and a method that will return a collection of bindable of objects -- not your usual DataSet or DataReader:

  • ADO.NET v2.0: ObjectSpaces Delivers an O/R Mapper

    ObjectSpaces is one of the most exciting parts of .NET v2.0 to me.  Yes, I'm well known for ASP.NET, but I'm a software architect, and I've really been intrigued by the potential of O/R mappers.  So read my article on ObjectSpaces and download my sample code that uses the Northwind database.  The front-end is ASP.NET, and there's no links between pages or any instructions, but the code works if you have Whidbey.

  • ASP.NET v2.0: Update on the Page Lifecycle

    I just posted a new article on the Page Lifecycle in ASP.NET v2.0 (Whidbey).  Its mostly just a brief update of my previous article on the Page Lifecycle in ASP.NET v1.*.  Keep in mind that the page lifecycle is probably the single most important thing for any ASP.NET developer to understand, and I can't begin to count the number of problems that I see in the Forums from those that don't get it.  I'll try to blog a few other experiences with .NET v2.0 today, and I'm going to work hard to get another article that will be really cool tomorrow, or as soon as possible.

  • VB.NET v2.0: Generics are Supported in VB Also

    Rob Chartier has created a really nice article titled Introducing .NET Generics.  Unfortunately, all of the sample code was written using C# -- just like every sneak peek on generics so far.  However, VB.NET will also fully support generics in .NET v2.0 (Whidbey), although not much has been stated about this.  Take a look at my VB.NET translations here -- you'll note that Of is the VB keyword used for generics, instead of using the <> syntax of C#. 

  • VB.NET v2.0: Generics are Supported in VB Also

    Rob Chartier has created a really nice article titled Introducing .NET Generics.  Unfortunately, all of the sample code was written using C# -- just like every sneak peek on generics so far.  However, VB.NET will also fully support generics in .NET v2.0 (Whidbey), although not much has been stated about this.  Take a look at my VB.NET translations here -- you'll note that Of is the VB keyword used for generics, instead of using the <> syntax of C#. 

  • ASP.NET v2.0: Code-Beside Replaces Code-Behind

    I'm not at the PDC, but that can't stop me from talking about .NET v2.0 (Whidbey) as of today.  I'll try to do even better than the folks at the PDC and actually post some real details!  That's right, my goal this week is to post a brief article each day at ASPAlliance.com.  I'll also try to blog some other shorter details based on my experiences this last year.  So, here's the first article: ASP.NET v2.0: Code-Beside Replaces Code-Behind.  ASP.NET v2.0 replaces the Code-Behind code-separation technique with Code-Beside, which is designed to be an easier and less brittle method based on Partial Types.  (Note: I'm glad they did not call this Code-Behind v2.0, which was one of the early candidates.)

  • ASP.NET v2.0 (Whidbey) Articles on ASPNetPro.com

    I've been watching ASP.NET Pro Magazine start releasing articles on ASP.NET v2.0 (Whidbey) this week.  Technically they seem to be jumping the gun a little ahead of the PDC, but go ahead and read them if you subscribe.  So far they've released the following 3 articles, including mine on Master Pages:

  • Sorting and Paging Recordsets in SQL Server

    Here's a stored procedure that I use for sorting and paging large recordsets in SQL Server, as opposed to using the more common and terribly inefficient entire dataset approach in .NET.  It certainly doesn't matter much in the little classroom examples of a few hundred, or even thousands, of records, but working with larger recordsets with datasets is just bad.  This is even more true with ASP.NET, since the entire dataset is usually saved in viewstate, and since the web server is doing the processing for many users.  This stored procedure is certainly not the only way to do sorting and paging in SQL Server, but it is probably the most efficient, although proper indexing is still required to avoid table scans.  Note that this does not use temporary tables, which are convenient but not as optimal -- this also means you could modify this to be dynamic SQL for Access or other databases!  The parameters are the name of the table, the name of the primary key (necessary for the little bit of optimization included), the name of the sort field (or sort fields, with or without ASC/DESC), and the page size (number of records).  It also allows optional parameters for the page index (defaults to 1st page) and a query filter (defaults to null) so you can sort and page through filtered records only!  Note that it returns two recordsets -- the first is the results you expect, and the second recordset is a scalar with the number of total pages so you can better define the GUI pager for a grid.  This is relatively easy to integrate with the ASP.NET datagrid if you use custom paging and sorting, and it will minimize both your load on the server and the amount of data sent to the client's browser!  By the way, this code is just modified from some I found on the net, and there are certainly some minor optimizations that can be done, like using different sql for the first page.

  • Observations on my Google Search Rankings

    I've watched several others, usually with less common names, note their high rankings in Google, but I usually didn't stand out unless you included “ASP.NET“ in your search.  Until now -- a search on “Paul Wilson” on Google returns my blog as #5-6 now, as well as listing my WilsonDotNet.com site as #6-7 -- pretty good for a common name like “Paul Wilson”. Also, a search on “Wilson Blog” lists my blog as the #3-4, and a search on “Wilson .NET” (without the full “ASP.NET“) finally ranks me as #1 -- even ahead of Brad Wilson, aka DotNetGuy! The funny thing is that I have not been ranking quite as high lately on more specific searches, like page templates, master pages, and multiple forms, where I used to rank as high as #1. Another observation is that I don't see my articles on ASPAlliance.com show up as high in the searches anymore -- anyone else noticing poor rankings for their ASPAlliance articles? Finally, even though I've never really figured out what to do with MicrosoftArchitect.com, I also now have MasterPage.net, in honor of the upcoming ASP.NET v2.0 Master Pages.