Wednesday, January 23, 2008

Shiny new thing to eat up bandwidth!

I'm a solo developer in a corporate environment, so I'm really on my own to learn new things.  As good as blogs and books are, there's sometimes no substitute for being shown how.  That's why Microsoft highlights so many videos on its asp.net site.  ASP Alliance also has a growing library of videos.

Enter onto this list one more site--DotNetVideos.net.  Right now there are around 100 videos on a great number of topics.  Apparently there are a couple hundred more in the pipeline.  And, if you sign up now, you get 6 months of ASP.NET Pro magazine for free.  That alone is worth the sign-up.  ASP.NET Pro is one of my favorite trade mags (I have an online subscription, and have for several years).

When you're Googling for info on whatever you're working on, don't forget to check out this site, too, and see if someone is showing you how it's done.

Full disclosure: I was asked to say something about the new site, and I usually ignore such requests.  But after checking it it, it's one I'll be spending some time on, and recommending to others.

(edit - fixed links)

Wednesday, January 23, 2008 11:03:13 AM (Eastern Standard Time, UTC-05:00)
 Tuesday, January 22, 2008

Assuming you don't actually have both a DataSource and DataSourceId defined on the same control, this may actually be a bug.  My situation is Visual Studio 2008, compiling an application for .NET 2.0.  I tested this with both Enterprise Library 2.0 and Enterprise Library 3.1.  For me, I'm trying to hydrate a RadioButtonList from a dataset, which is created from a stored procedure call with a parameter passed.  If I hardcode some values in the sproc and don't pass the parameter, it all works fine.  But, if I pass the parameter, I get the error.  I have a workaround in mind, and I'll post it whenI get it done.

I reported this at http://connect.microsoft.com/, with an issue ID = 323454; the title is "Both DataSource and DataSourceID are defined...".  If you're having the same problem, log in and vote for this issue--more votes = higher priority.  The text of my report is below:

I'm using VS 2008 (9.0.21022.8 RTM), compiling for the .NET 2.0 framework.

On a web form, I've added a RadioButtonList, as below:

<asp:RadioButtonList ID="rblShippingPlatform" runat="server" CssClass="FormFieldsAjax" />

In code behind, I call a function in a CBO in the same project to hydrate the values:

cPub.fillShippingPlatforms(rblShippingPlatform, cPublic.Segment.Lane)

The function in the CBO makes a call to the DAL, which is a shared library added as a project reference:

    Public Sub fillShippingPlatforms(ByVal rblPlatforms As RadioButtonList, ByVal sSegment As String)
        With rblPlatforms
            .DataSource = cDb.GetShippingPlatforms(sSegment)
            .DataValueField = "ShippingPlatformID"
            .DataTextField = "ShippingPlatform"
            .DataBind()
        End With
    End Sub

The DAL simply executes a stored procedure and returns a dataset:

    Public Function GetShippingPlatforms(ByVal sSegment As String) As DataSet
        dB = DatabaseFactory.CreateDatabase
        cmd = dB.GetStoredProcCommand("lpGetShippingPlatforms")

        With dB
            .AddInParameter(cmd, "@Segment", DbType.String, sSegment)
            Return .ExecuteDataSet(cmd)
        End With

    End Function

There's nothing fancy here, but when I load the web form, I receive an error stating "Both DataSource and DataSourceID are defined on 'rblShippingPlatform'. Remove one definition. ".

I can hydrate the RadioButtonList if I adjust the stored procedure and remove the parameter handling.

    Public Function GetShippingPlatforms(ByVal sSegment As String) As DataSet
        dB = DatabaseFactory.CreateDatabase
        Return dB.ExecuteDataSet(CommandType.StoredProcedure, "lpGetShippingPlatforms")
    End Function

This issue occurs with both the Jan 2006 and May 2007 versions of the Enterprise Library.

Tuesday, January 22, 2008 11:22:04 AM (Eastern Standard Time, UTC-05:00)
 Wednesday, April 18, 2007

My buddy Shaun Eutsey had his first ASP Alliance article published today:

CodeSnip: Taming the Page Flash Beast in ASP.NET 2.0

Since SmartPageNavigation has gone to the wayside, there has been no real, non-AJAX way of eliminating the flash when a postback occurs. This code snippet will explain how to eliminate the page flash without using AJAX.

Congrats Shaun!

Read the full article at http://aspalliance.com/1232_CodeSnip_Taming_the_Page_Flash_Beast_in_ASPNET_20.

 

Wednesday, April 18, 2007 1:29:07 PM (Eastern Standard Time, UTC-05:00)
 Friday, February 23, 2007

Embedded resources in ASp.NET 2.0 are served up by a file listed as WebResources.axd.  If your validators aren't working, or treeview or sitemap images aren't showing, see if the debugging steps at http://www.rosshawkins.net/rfh/articles/webresource.axd.html fix your problem.

However, if you're running URLScan on your server, you may need to specifically allow the .axd extension in the .ini file.  Once we did that, our sitemap was good as gold.

Friday, February 23, 2007 5:49:18 PM (Eastern Standard Time, UTC-05:00)
 Tuesday, January 23, 2007

The folks at ASP.NET have posted a new By The Community, For the Community poll.  Choices are pretty good--an e-commerce extension to the Small Business Starter Kit, an events calendar, AJAX popup calendar, an image gallery control, or a DB-driven menu with roles.  So far, the menu is way in the lead.

Vote at http://asp.net/default.aspx?tabindex=6&tabid=50.

Tuesday, January 23, 2007 5:34:06 PM (Eastern Standard Time, UTC-05:00)
 Tuesday, January 16, 2007

My latest ASP Alliance article has been published: Review: ASP.NET 2.0 Web Parts in Action

ASP.NET 2.0 brought us all sorts of new technologies and one of the most exciting is Web Parts. Web Parts are versatile contols over which the end user can exhibit some level of control and form the basis of portals. In his recently published book, Darren takes us from the very basics of web parts and portals to advanced techniques of portal building. Darren's book is well written, and illustrated with screenshots and code (which can be downloaded from the publisher's website).


ASP.NET 2.0 Web Parts in Action

kick it on DotNetKicks.com

 

Tuesday, January 16, 2007 9:36:38 AM (Eastern Standard Time, UTC-05:00)
 Wednesday, October 25, 2006

Wally McClure has posted a very timely ASP.NET podcast, entitled "Building Section 508 Compatible Applications with ASP.NET".  This is very timely because a blind advocacy organization has filed suit regarding the accessibility of websites.  The news broke yesterday; full story at http://www.foxnews.com/story/0,2933,224617,00.html.

Now, CYA and go get you some more Wally!

Wednesday, October 25, 2006 5:14:07 PM (Eastern Standard Time, UTC-05:00)
 Wednesday, October 11, 2006

VS 2005 Unleashed

After a couple of publishing delays, I received my copy of Visual Studio 2005: Unleashed a week or so ago (ordered for Christmas 2005).  The first thing you notice when you pick up this book is that it’s GINORMOUS.  No joke—832 pages of VS 2005 goodness.

I’m not done with it yet—not by any stretch of the imagination.  That would require a diet much higher in fiber.  But, like all books in the Unleashed series, this one is well written, with copious code samples and illustrations.

Code samples, you ask?  Oh yes, there are some.  Aside from the chapter on language enhancements in C# and VB.NET, there are examples for creating your own code snippets, writing Visual Studio 2005 add-ins, and creating templates you can share with the community.  How-to’s are illustrated with screenshots.

Informaion I’m eager to dig into includes refactoring, unit testing and managing databases via VS 2005.  I’ll have a more formal review once I reach the end.

Wednesday, October 11, 2006 7:38:20 PM (Eastern Standard Time, UTC-05:00)
 Friday, September 22, 2006

The first two  projects have been released.  Brendon Schwarzt brings us an Extended Club Site Starter Kit, and Curt Christiansen brings us ITracker, an inventory tracking app.  More information on each at http://www.asp.net/Default.aspx?tabindex=6&tabid=50.

Friday, September 22, 2006 8:10:59 PM (Eastern Standard Time, UTC-05:00)
 Tuesday, August 15, 2006

TheBeerHouse starter kit enables you to implement a website with functionality typically associated with a CMS/e-commerce site. This website demonstrates key features of ASP.NET 2.0...

Features include WebParts, Master Pages, Membership & Profile, and on-line payment clearing.  Don't forget the SSL!

Full story at http://www.asp.net/downloads/starterkits/default.aspx?tabid=62#beerhouse.

kick it on DotNetKicks.com

Tuesday, August 15, 2006 3:19:27 PM (Eastern Standard Time, UTC-05:00)
 Sunday, August 13, 2006

 I wasn’t aware of this until I saw Don’s article:

Fortunately, Microsoft has committed to providing a steady stream of documentation and educational materials to help solve the problem. Their latest ASP.NET security freebie has the rather unwieldy moniker of ASP.NET 2.0 Security Reference Implementation. This product is a combination of documentation and source code that is worthwhile to study to get right at the best practices that you can implement in ASP.NET 2.0 Web sites. The package itself is a bit daunting, but it doesn’t take long to figure out what’s what.

There are two Word docs and 17 projects, released under a GotDotNet license so you can lift entire projects for your own needs.  I found MS’s P&P guides absolutely essential for working with .NET 1.1, so I’m glad to see some updated material.

kick it on DotNetKicks.com

Sunday, August 13, 2006 4:33:10 PM (Eastern Standard Time, UTC-05:00)
 Thursday, July 06, 2006

Recently, a question came up in the ASP.NET security forums about the lack of a remote membership/role configuration tool in ASP.NET 2.0.  Being able to remotely manage users is important in pretty much any site where you have users.  Fortunately, QualityData has stepped in and developed that plus a little more in their Membership Manager Control.  Apparently works in AJAX and exposes an API as well.  At $59, it's pretty darn cheap, too.

If you need a free license (beyond the trial version) for your needs, they also have a link-for-license program.  Add a link like Asp.Net Server Controls by Quality Data, and let them know.

Thursday, July 06, 2006 3:34:38 PM (Eastern Standard Time, UTC-05:00)

The result of the problem is that search engines won't index the content on your Community Server based site.  That's bad if you're counting on being found in the SEs.

The problem appears to be a bug (or a feature nobody wants) in the URL Rewriting part of ASP.NET 2.0.  When the URL is rewritten and the response is redirected to the destination URL, a result code of 302 (temporary redirect) is returned, instead of 200 (destination found OK).  Most SEs won't index pages that return a 302, since that is a trick heaviliy used by SE spammers.

Matt Cutts has a post about this at http://www.mattcutts.com/blog/asp-net-2-and-url-rewriting-sometimes-harmful, and there's discussion at Telligent at http://communityserver.org/forums/536640/ShowThread.aspx.

This isn't to call out Telligent, since anyone using the built-in URL Rewriting will be affected.  I just think the thread on their site is a good one to watch.

Thursday, July 06, 2006 1:13:43 PM (Eastern Standard Time, UTC-05:00)
 Wednesday, May 24, 2006

My latest ASP Alliance article has been published, titled Getting Started with the Club Site Starter Kit:

Since the release of ASP.NET 2.0, several starter kits have been released as examples of programming practices. These kits are also good starting points for actual websites and can be valuable to novice webmasters. This article will demonstrate how to download and install the Club Site Starter Kit, configure a different database to prepare for a production site and change the appearance by modifying the master page.

There is one correction to the article--Listing 4 is incorrect.  The MasterPage filename in Figure 20 should be "caddyshack.master", and Listing 4 should then read:

<%@ Page Language="VB" MasterPageFile="~/caddyshack.master" Title="Untitled Page" %>

Find the full article at http://aspalliance.com/839.

 

Wednesday, May 24, 2006 1:27:49 PM (Eastern Standard Time, UTC-05:00)
 Tuesday, May 23, 2006

Eric says crazy filename parsing is something else you should stop doing.  If you're creating output files, you probably need to timestamp the file name to keep the files separate.  Step away from the keyboard before you do anything crazy--you can do this in one line of VB.NET:

Dim _filename As String = String.Format("MyFile.{0}.xml", Now.ToString("yyyyMMddHHmm"))

 

Tuesday, May 23, 2006 5:17:00 PM (Eastern Standard Time, UTC-05:00)