This post originated from an RSS feed registered with .NET Buzz
by Duncan Mackenzie.
Original Post: More playing with ASP.NET
Feed Title: Code/Tea/Etc...
Feed URL: /msdnerror.htm?aspxerrorpath=/duncanma/rss.aspx
Feed Description: Duncan is the Visual Basic Content Strategist at MSDN, the editor of the Visual Basic Developer Center (http://msdn.microsoft.com/vbasic), and the author of the "Coding 4 Fun" column on MSDN (http://msdn.microsoft.com/vbasic/using/columns/code4fun/default.aspx). While typically Visual Basic focused, his blogs sometimes wanders off of the technical path and into various musing of his troubled mind.
As with my earlier messing around with a poll, I took a concept from the www.asp.net site today and made my own "CheckDotNet.aspx" page. The one on www.asp.net only checks for the .NET Framework 1.0 or better, so I modified the logic to detect 1.1 and 1.0 as two distinct cases... recommending an upgrade for no framework or 1.0, and returning "Framework Found" if you have 1.1 already.
Useful? I have no idea, but I thought it was worth putting up. The page has only one bit of code, the load event handler (and yes, I know I could have overriden OnLoad... but the code I started with was using Page_Load, so I just went with it)...
Sub Page_Load(sender asObject, e as EventArgs) Dim clrVersion as Version = Request.Browser.ClrVersion If clrVersion.Major > 0 Then If clrVersion.Minor > 0 Then aOkPanel11.Visible = True Else aOkPanel1.Visible = True EndIf Else downloadPanel.Visible = True EndIf EndSub
aOkPanel11 on my page contains the text to show if the user has the 1.1 version of the Framework... aOkPanel1 is shown if they have 1.0 only, and downloadPanel appears if they have no Framework at all.
Sadly, I have to admit that I haven't found a machine around the house or office without at least the .NET Framework 1.0 on it, so I haven't been able to completely test the page :)