Archives

Archives / 2005
  • Watch Out for Request.Browser.MajorVersion in ASP.NET 2.0

    I awoke to 1500 exceptions published to me this morning from our public site running ASP.NET 2.0.  Not good times.  "Luckily" they were all the same: Value cannot be null.  It seems one of the components that we are using is calling Request.Browser.MajorVersion and blowing up on goofy user-agents.  In this case the user-agent of doom is "YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)".  For whatever reason ASP.NET 2.0 cannot parse the MajorVersion out of that and tries to call int.Parse on a null value, causing an error.

  • Installing Ubuntu on Virtual PC 2004

    I decided to give Ubuntu a try in Virtual PC to see how this distro works.  So far, I'm pretty damn impressed.  But getting it up and running in a Virtual PC wasn't quite as obvious as I hoped it would be.  Here are the steps if anyone else wants to try out this distro.  I basically just went through a default install, and when the thing booted up it freaked out on the display.  This is actually quite common with Linux distros that I've tried in Virtual PC.  Keep in mind, I'm not even too terribly sure how to pronounce Linux, so I just kinda faked my way through the steps.  You might know a really cool way to do some of these steps, and that would be great if you let me know

  • Accessing the Html Header in ASP.NET 2.0

    I feel a bit silly for not figuring this out quicker, so hopefully I can redem myself by posting this to help people out.  Taking a look at the Page class there is a Header property that looks tempting to be able to do something like dynamically add a stylesheet.  The problem is that when you type in Page.Header it doesn't appear that you have full control over the header, even though there is the ever so tempting System.Web.UI.HtmlControls.HtmlHead class.  What I had been doing is throwing an id and a runat="server" onto the head tag in my HTML, which I really didn't like because an id tag on the head tag isn't valid XHTML 1.1. 

  • The Curious Incident of the App_Offline.htm in your ASP.NET 2.0 App

    I've gotten more than three issues sent to me recently regarding why an ASP.NET 2.0 app suddenly starts throwing up 404 errors, and each time there is a single culprit: app_offline.htm.  I'd point towards some documentation, but honestly I just can't find any out there, so hopefully this will help people figure out what is going on.  When ASP.NET 2.0 sees this file, it basically shuts down the process.  This is useful if you need to over write a MDB file for example.  

  • Deploying the ASP.NET 2.0 Personal Site Starterkit

    I've seen quite a few questions regarding how to deploy the Personal Site Starter Kit to a hosting account, so I thought I'd write up some guidelines on how to do this.  These directions have really only been tested with the MaximumASP's free beta account, but they should work with any of the other providers assuming they give you some type of SQL Server as the backend.

  • Premature Jubilation

    Oliver Sturm sent along a couple of links to his blog where he's taken a much deeper look than my "oooooooh, pretty!" reception to the new image library that is shipping with VS2005.  And after taking a deeper look at these images, I've come to the same conclusion:  ugh.

    Like Oliver said, if you want an app that looks good (or aren't creating VS2005), then you might want to venture over to glyFX or my favorite Glyfz.  It looks like Glyfz is even offering their alpha-blended PNG images for free when you buy the Office 2003 style image set.  That's a deal in a half.  Now all I need is an excuse to throw away our UI to get my boss to buy the set...

  • New Graphics with VS 2005

    Holy crap, just found these things in my Visual Studio 8\Common7\VS2005ImageLibrary folder.  In there you will find a zip file with about 800 images to use in your apps.  Unfortunately these all look to be 16x15 in bitmap format and not png or gif for the web, but hey, it's a start.  This is something I've been complaining about for years.  Should be great for winform toolbars, but not so useful for the web.

    No new icons though.  It looks like giving applications the rocket ship icon will still trendy.

    Post Script:  As I finished typing this up, this movie popped up in my RSS reader as an introduction to the VS 2005 Image Library.  Sweet!

  • Validating XHTML with ASP.NET 2.0

    With the go-live of ASP.NET 2.0, I've been actually using it at a level of more than "ooh, pretty new feature." I'm kinda of a standards nerd, so naturally I've been messing around with the XHTML output and making sure I like what I'm seeing.  So far, so good. But I ran my page against the W3C's validator and it freaked out, complaining about form tags having names and the such. So I take a look at the source, and it looks good to me. So I go back to the validator, and run it one more time, this time enabling "Show Source." Ah, there's the problem. ASP.NET thinks that the validator is some ghetto browser from 1996 so it is sending it invalid markup.

  • Bug or Not?

    Hmmm, I forget how the box model is supposed to do things in CSS, but this seems a little off to me.  What I had was a div tag with a width of 500px.  Within that I have a nested div with a margin of 25px.  I WAS trying to avoid having to do a box model hack to make sure things look OK in IE 5.x. 

    So everything is hunky dory until I take this layout and put it into a masterpage in VS2005.  I drop the ContentPlaceHolder and suddenly my 500px div is 550px large.  It seems VS2005 is trying to figure out how wide to make the ContentPlaceHolder "container," and forgetting about the margins (or padding (or borders)).  This also happens when you have a panel or anything else set to a width of 100%.  So it is just pushing it wider.  And since I'm using floats to do the layout, in VS2005 it is pushing my sidebar down because it is too wide to fit into the container.  IE 6.0 and Firefox seem to be getting this "right," but honestly I'm not too sure when Firefox is immulating bugs in IE or when IE is in compliance mode anymore.

    I'm leaning towards bug.  If anyone is curious, here's the fancy code that is screwing stuff up:

            <div style="width: 500px">
                <div style="padding: 25px; background-color: Orange; border: solid 1px black">
                    <asp:Panel runat="server" ID="test" style="width:100%">
                        jyeretjetjetj</asp:Panel>
                </div>
            </div>
            <div style="width: 500px; border: solid 1px black">
                another 500px div
            </div>


    Take out the panel and just put normal text (or even just a div with width=100%) and it displays fine.

    So, bug or not?

  • Funny places you see ASP.NET

    Even though ASP.NET has been out for quite some time, it still tickles me to see sites with an aspx extension.  I recently checked out one of my favorite bar's site, O'Shea's Irish Pub here in Louisville, and was surprised to see it was running ASP.NET on Windows 2003. 

  • Want to get rid of spyware? Install this ActiveX control when prompted!

    I'm sure you've seen the new Anti-Spyware tool from Microsoft, so I'll spare you the elevator pitch.

    What I want to know is what brainiac decided that to install the thing you might want to either install an ActiveX control, or download an EXE file an execute it to continue? Um, isn't this crap the reason 99.9999% spyware gets installed?  Shouldn't that type of behavior be discouraged?  I was hoping that when I clicked next I'd get a screen saying "YOU FOOL!  You could have just installed something that is reporting your bank password to some crazy guy in Canada!  Don't do that crap, and maybe you wouldn't need to install this tool, moron."  But no, it actually popped up a file for me to execute (I'm running Firefox, I assume it would be an ActiveX control for IE).  FANtastic. 

     Thankfully, you can skip that step and just download the thing.  The irony of this product just gets deeper and deeper.