About the author

Rob Schieber is a developer in Columbus, Ohio.
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sys.WebForms.PageRequestManager is null or not an object

I just spent a good portion of the day tryoubleshooting why we were getting this javascript error in out prod environment, but not in our development environment.  Specifically, the error was happening with a Telerik Popup control, but judging from a few google searches, I think that it is more specific to the ASP.Net Ajax extensions.

There a probably quite a few different causes of this problem, but I was able to fix it by removing the <xhtmlConformance mode="Legacy"/> node in my web.config file.  The xhtmlConformance setting appears to determine how controls render to the clients browser. The default is transitional.  It does not seem to play well with the Asp.net Ajax extensions if you have it set to legacy.

 UPDATE:
Looks like Scott Guthrie has already posted a gotcha on this.  Amazing that a google search for the error wouldn't pull it up.


Posted by sheebz on Monday, June 30, 2008 1:58 PM
Permalink | Comments (0) | Post RSSRSS comment feed

The P.G. Wodehouse Method Of Refactoring

I came accross a pretty good post on refactoring today on Basildon Coder.  The post offers some sound advice on when and how to refactor code.  I found the following paragraph quite insightful regarding completely rewriting existing code. 

"The problem is that warty old code isn’t always just warty - it’s battle-scarred. It has years of tweaks and bug-fixes in there to deal with all sorts of edge conditions and obscure environments. Throw that out and replace it with pristine new code, and you’ll often find that a load of very old issues suddenly come back to haunt you."

All too often we come accross code we don't like.  I've come across some real gems in my career, and I am positive that I have created some truly horrible code in my life.  I think that the first reaction that we have when we see ugly code or poorly designed systems is to push for a complete rewrite.   This is a normal reaction, but I think that a complete re-write should really only be used as a last resort.  It will always be a bigger task than it initially seems.  The best choice, and often more challenging is to figure out a way to refactor the problem code.


Categories: Refactoring
Posted by sheebz on Friday, June 27, 2008 10:40 PM
Permalink | Comments (0) | Post RSSRSS comment feed