Monday, February 26, 2007

Looks like one of my favorite web blogs, "TheDailyWTF", is going PC and changing its name to "Worse Than Failure". You can guess what the original "WTF" stood for.  It is his blog, so he can do what he pleases with it, but I do like the original name better.

 

posted on Monday, February 26, 2007 2:14:42 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Sunday, February 25, 2007
 At work I decided to add Ajax 1.0 for ASP.NET to a few of my web pages. With not a lot of time to dig into it, I wanted something simple and fast to use at first. Later, I could dig into using the more sophisticated features of Ajax.  

The UpdatePanel along with the UpdateProgress control seemed to be the perfect solution. Both work just like a standard panel control that holds other web controls like a container.

These extensions are really slick, but I ran into a few issues with Response.Write

My code has a routine that spawns an java alert box to display any errors messages. This is pretty standard code and will display a small popup window to output your message. This is pretty much a standard way of displaying a quick message to the user.  Nothing very special about this, except that it doesn't work with the new Ajax extensions. smile_sad 

 

   1:  Protected Sub PopErrorWindow(ByVal ErrMsg As String) 
   2:   
   3:        Response.Write("<script language='javascript'>window.alert('" & ErrMsg & "');</script>") 
   4:   
   5:  End Sub

 

After embedding my controls within the update panel, I started getting the following error from the Response.Write in the code above. It seems that Ajax doesn't like the partial postback that I was doing.

I talked it over with a co-worker and after a bit of Internet searching and experimenting around with code, I was able to come up with the following code as a solution. Seems to work fine and I haven't found any other side effects.  smile_teeth

 

   1:  Protected Sub PopErrorWindow(ByVal ErrMsg As String)
   2:   
   3:          ScriptManager.RegisterClientScriptBlock(Me.UpdatePanel1, Me.GetType, "Alert", "alert('" + ErrMsg + "')", True)
   4:         
   5:   End Sub

 

I hope this helps anyone else out there having a similar problem.

posted on Sunday, February 25, 2007 9:39:09 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]


No I never worked for Apple, but the guy in this video did. He worked for Apple's customer telephone support line and was fired two days after he read a poem about their customer support center for the company talent show. I can only imagine it was the comment about "Stupid, rude American customers" during his ode to the Canadian FedEx Lady.  Either way, it damn funny.

posted on Sunday, February 25, 2007 8:53:47 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Wednesday, February 07, 2007

Now don't get me wrong, I am a Windows guy and do run Vista, but I do enjoy the of the Apple Commericals. I found this one to be cute and wanted to share it.

posted on Wednesday, February 07, 2007 9:07:56 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


From an article on TechRepublic entitled Don't be misled by these 10 Windows Vista myths, here is a summary of the myths. 

Myth #1: You'll have to buy a new, high-end PC to run Vista

Myth #2: Vista will solve all your security problems

Myth #3: Vista is no more secure than XP SP2

Myth #4: The only thing new about Vista is the eye candy

Myth #5: You can't dual boot Vista with another operating system

Myth #6: Vista requires (or includes) Office 2007

Myth #7: Most old applications and peripherals won't work with Vista

Myth #8: You have to buy a Premium version of Vista if you have a dual core machine

Myth #9: You won't be able to play ripped music in Vista

Myth #10: Vista costs a lot more than XP

Since I use Vista on a daily basis, I can assure you that these are false. 

posted on Wednesday, February 07, 2007 8:43:32 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]


 Monday, February 05, 2007

I was reading through my backlog of feeds ( which has gotten huge ) and ran across this little gem. It is a very cool feature of ASP.NET 2.0 that I had missed. In fact, I can't seem to find any reference to it in two of my ASP.NET 2.0 books. This feature is quite simple to use and extremely useful.

There are times when you may want to take your ASP.NET application offline. You may be doing a major upgrade to the code or need access to resources that may be tied up. You certainly don't want your customers seeing a "Page not Found" or some some other type of error due to upgrading code or maintenance of some sort. You want them to get a page with information on what is happening and maybe when to check back.

ASP.NET 2.0 has a special filename called app_offline.htm. This file is a standard html document and when present in the application root directory, will be shown in place of all other page requests. You can have this file on standby and when upgrade time rolls around you can simply drag the file into the application directory to be updated, update your files, and once finished you would delete the file from the directory. 

You should also note that Internet Explorer has a habit of showing "Friendly Http Errors" when the content is less than 512 bytes long. To work around this, you should either insure your page greater than 512 bytes or add some comments in the mark up to make up the difference.

The following is an example of a app_offline.htm file. The content is not limited, so you can pretty much make it say whatever you want.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Application Offline</title>
</head>
<style>
 
div {
    background-color:#ffffcc;
    padding-top:10px;
    padding-bottom:10px;
    padding-left:10px;
    padding-right:10px;
    border-style:solid;
    border-color:Black;
    border-width:1px;
}
 
</style>
<body>
    <div>
    This application is currently offline and under going maintenance. Please check back later.
    </div>
</html> 
 
This is a very simple example file. You can make yours nicely formatted with whatever graphics you require. 
 
posted on Monday, February 05, 2007 2:20:04 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]