Scott Hanselman

I'm late but: How I got into Computers

November 21, '03 Comments [3] Posted in Musings
Sponsored By

This is late, as many others have already shared their stories, but here's the short story on how I got into computers.

In the neighborhood I grew up in, I was apparently be labeled "at risk."  Probably would have been vote most likely to be convicted of a white-collar crime.  One day there was some kind of parent-teacher-school district superintendant meeting and they decided if we don't give this kid something to do, we're going 'lose him.'  So, my fifth grade teacher let my dad and I borrow the Apple II computer over the weekends.  I started using friends' TI89/A's and spent more than one weekend typing and printing a 20 page (20 pages of 8x11 ASCII ) poster of Mister Spock on a TRS/Trash80.

Then, a few months later, the parents sold our van to buy me a Commodore 64, and a few copies of COMPUTE! magazine pretty much insured I'd be indoors for life.

Fast forward 5 years (various operating systems I used described here in an earlier unrelated post) and I was selling my services (which consisted of a complex 'document recovery' racket at local high schools [né 'business'] as Tweak Inc. running entirely off a single copy of Norton Disk Doctor).

Fast forward a few more years and I was running Tweak Computer Support and BBS and programming Win16 apps in C.

Fast forward a few more years and I sell Don Box a Newton on opening day

Fast forward a bit more and you can find me posting on USENET from nike.com.

Fast forward <10 years and I'm working at Corillian Corporation and blogging with you fine people.  And it all started with my fifth grade teacher letting me type 'CATALOG' into an Apple II.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

ASP.NET: Postbacks for Algernon

November 20, '03 Comments [2] Posted in ASP.NET | Javascript
Sponsored By

We're hip deep into this bank today.  Doing some amazing stuff and making a very rich user experience with as few moving parts as possible.  Reuse, Reuse, Reuse.

Here are some interesting things I've learned/been reminded of

  • Pretty PostBacks when using RewritePath: When you call HttpContext.RewritePath to make “junk.aspx?specialparam=Y“ look like “someotherpage.aspx“ it will look nice in the Browser's Location Bar, but not in the Form Action.  Consequently, when you postback, you'll see the ugly URL in the Browser's Location Bar.
    • So, call Page.RegisterStartupScript with this little block:

      Page.RegisterStartupScript("rewritepathfix","<script language='javascript'>document.YourFormNameHere.action = document.location.href;</script>");
  • Complex Custom Confirmation Dialogs on LinkButtons in DataGrids while STILL maintaining PostBacks (whew!): If you want to have a javascript:confirm() dialog popup when clicking on a LinkButton (not a Button), BUT you want the javascript dialog to contain a context-specific message based on data, AND you still want a PostBack event to occur:
    • Chain the JavaScript events by grabbing the LinkButton in the Grid's ItemDataBound.  Make a parallel HyperLink with an onclick that contains your javascript confirm, THEN the PostBack javascript, which can be got to via Page.GetPostBackEventReference.  In this example the function GetConfirmJavascript builds a confirm(”yada yada”) string based on the object passed in.

      public void GridDataBound(Object sender, DataGridItemEventArgs e)
      {
         if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
         {
            string target = string.Empty;
           
      HyperLink linkCancel = new HyperLink();
         
         LinkButton linkButtonCancel = (LinkButton)e.Item.Cells[CancelColumn].FindControl("LinkButtonCancel");
            linkEdit.Text = linkButtonEdit.Text;
            target = Page.GetPostBackEventReference(linkButtonEdit);
            linkCancel.NavigateUrl = GetConfirmJavascript(e.Item.DataItem as MyObject, target);
            linkButtonCancel.Visible = false;
            e.Item.Cells[CancelColumn].Controls.Add(linkCancel);
         }
      }

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

My Ultimate TabletPC

November 19, '03 Comments [4] Posted in Musings
Sponsored By

It's out and here's the scoop.

  •   Intel® Centrino™ Mobile Technology
  •   Microsoft® Windows XP Professional Tablet Edition
  •   Microsoft® Office OneNote™ 2003
  •   High resolution 12.1" SXGA+ (1400 x 1050) display*
  •   Up to 4.34 hours² battery time
  •   NVIDIA® GeForce™ FX Go5200 32M graphics w/32MB DDR memory
  •   Integrated Wi-Fi™ (802.11b), 10/100 Ethernet, V.90/56K modemº

It's got a 1.5Ghz Processor and up to a Gig of RAM.  Note that they wimped out on the 128Megs of RAM, but it DOES HAVE 1400x1050 RESOLUTION!

Sold. I mean, Bought.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Brainfart? or ASP.NET madness

November 19, '03 Comments [4] Posted in ASP.NET
Sponsored By

I need a function from ASP.NET that gives me, reliably and guaranteed, without a config file, the base virtual directory of the current website.  So if I'm in c:\inetpub\wwwroot\web (ne http://localhost/web) then I want “/web/.” 

But (here's the fart part) I can't seem to find a way that gives it to me INDEPENDANT of the current Context's path.  Meaning, if the VERY FIRST (app start) page hit on the site is http://localhost/web/balances/balances.aspx then I still need “/web/“ not “/web/balances/.“

This is the closest I've got:

return HttpRuntime.AppDomainAppVirtualPath + "/";

However, this appears to occasionally (read: flaky) return a different path like /web/images/ or /web/someotherpagedirectory. 

What am I missing?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

My Christmas (or Birthday List)

November 16, '03 Comments [5] Posted in Gaming
Sponsored By

So I was typing up a Christmas List (or birthday, as mine is in January) for the wife, and I figured certainly you, dear reader(s), would care to see it (I encourage you to do the same!):

In no particular order

Most wanted:

Wanted:

I hope you enjoy reading about them as much as I will enjoy getting them (well, I'll probably get just one)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.