MBC Computer Solutions Ltd.

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, 3 September 2008

Serving up the MS AJAX Runtime as a CompositeScript

Posted on 11:30 by Unknown

ASP.NET 3.5 SP1 introduces script combining to the ScriptManager.  To take advantage of this feature with your own scripts, you simply wrap  you <Scripts>...</Scripts> block with a <CompositeScript>...</CompositeScript> block.  This is great, but if you've spent any time analyzing your site with a HTTP tracing tool like Firebug, Web Development  Helper or Fiddler, you'll notice that the MS AJAX Runtimes (MicrosoftAjax.js, MicrosoftAjaxWebForms.js) is still served up separately.  It turns out that getting these to be served as part of the combined script is relatively straight forward and entails manually including the scripts within your <CompositeScript> block.  Since the names are unique, the ScriptManager will not re-add the runtime libraries.  The final result looks like:

<asp:ScriptManager runat="server" ID="scriptManager">
    <CompositeScript>
        <Scripts>
            <asp:ScriptReference Name="MicrosoftAjax.js" />
            <asp:ScriptReference Name="MicrosoftAjaxWebForms.js" />
            <asp:ScriptReference Path="~/scripts/YourScript.js" />
        </Scripts>
    </CompositeScript>
</asp:ScriptManager>

Read More
Posted in | No comments

Tuesday, 19 August 2008

Watch out for maxAllowedContentLength - its in bytes!

Posted on 08:14 by Unknown

I was just troubleshooting a HTTP Error 404.13 - Not Found error in one of applications that handles some large file uploads.  I had set my maxAllowedContentLength to 2097151 (which is the max allowed value for the httpRuntime maxRequestLength parameter, in KB).  Oddly, it wasn't working and I was still receiving the 404.13.

Some time later, after actually reading the MSDN documentation, it clicked to me that maxAllowedContentLength is in bytes, not kilobytes! Doh!

Read More
Posted in | No comments

Tuesday, 22 July 2008

Popup Window Manager

Posted on 13:59 by Unknown

I was just reading a post by Rick Strahl about managing popup windows in the browser.  I actually authored a mini popup window manager a while back that tracks windows, allows you to easily close them, and most importantly (for my app I suppose), can prevent the same window from being opened twice, and if encountered, will simply focus that window.

The code is for MS AJAX but could easily be adopted for other platforms.

To use it, you need to register it globally via the pages Load event:

Sys.Application.add_load(function(sender, args) {
                window.popupWindowManager = new Mbccs.Psp.Web.Manager.PopupWindowManager(); 
            });

And to open a window (using the default height and width):

window.popupWindowManager.openWindow('myPage.aspx', false);

If you want to override the width/height:

window.popupWindowManager.openWindow('mypage.aspx', false, 800, 800)

The code looks like:

Mbccs.Psp.Web.Manager.PopupWindow = function Mbccs$Psp$Web$Manager$PopupWindow(url, handle, allowDuplicates) {
    this._url = url || null;
    this._handle = handle || null;
    this._allowDuplicates = allowDuplicates;
}

Mbccs.Psp.Web.Manager.PopupWindow.prototype = {
    get_url : function Mbccs$Psp$Web$Manager$PopupWindow$get_url() {
        return this._url;
    },
    get_handle : function Mbccs$Psp$Web$Manager$PopupWindow$get_handle() {
        return this._handle;
    },
    get_allowDuplicates : function Mbccs$Psp$Web$Manager$PopupWindow$get_allowDuplicates() {
        return this._allowDuplicates;
    }
}
Mbccs.Psp.Web.Manager.PopupWindow.registerClass('Mbccs.Psp.Web.Manager.PopupWindow');

Mbccs.Psp.Web.Manager.PopupWindowManager = function Mbccs$Psp$Web$Manager$PopupWindowManager() {   
    this._windows = [];   
}

Mbccs.Psp.Web.Manager.PopupWindowManager.prototype = {
    openWindow : function Mbccs$Psp$Web$Manager$PopupWindowManager$openWindow(url, allowDuplicates, width, height) {
        var allowOpen = true;
        var previousWindow = null;
        var previousWindowIndex = -1;
        var windows = this._windows;
        // Check for existing
        for(i = 0; i < windows.length; i++) {
            if(windows[i].get_url() == url) {
                allowOpen = windows[i].get_allowDuplicates();
                previousWindow = windows[i];
                previousWindowIndex = i;
                break;
            }
        }       
        if(!allowOpen) {
            if(previousWindow.get_handle().closed) {
                Array.removeAt(this._windows, previousWindowIndex);
                allowOpen = true;
            }
        }
        if(allowOpen) {
            var _width = width || 750;
            var _height = height || 700;
            var winName = 'win' + Math.floor(Math.random() * 100 + 1);
            var curWin = window.open(url, winName, 'width=' + _width + ',height=' + _height + ',resizable=yes,scrollbars=yes');                   
            var win = new Mbccs.Psp.Web.Manager.PopupWindow(url, curWin, allowDuplicates);                       
            this._windows.push(win);
            return win;
        } else {
            previousWindow.get_handle().focus();
            return previousWindow;
        }
    },
    closeAll : function Mbccs$Psp$Web$Manager$PopupWindowManager$closeAll() {
        var curWin = this._windows.pop();
        while(curWin != null) {
            curWin.get_handle().close();
            curWin = this._windows.pop();
        }
    }   
}

Read More
Posted in | No comments

Monday, 7 July 2008

Using Virtual Machine Manager 2008 to manage Virtual Server 2005

Posted on 16:13 by Unknown

I was trying to add a Virtual Server 2005 host to a Virtual Machine Manager 2008 Beta and I kept receiving the following error:

Error (421)
Agent installation failed on MBC02.mbccs.internal because of a WS-Management configuration error. 

Recommended Action
See the Virtual Machine Manager Help for information about configuring WS-Management.

 

Of course, being a beta product, that help section didn't exist and a search for "WS-Management" didn't yield anything.  WS-Management is installed by adding "Hardware Management" from Windows Components > Management and Monitoring tools (WinRM service), and this was installed on my server so I was pretty confused as to why I was receiving this message.

It turns out that you need to install WS-Management v1.1 which is provided as a hotfix from Microsoft.  You can download it from http://www.microsoft.com/downloads/details.aspx?FamilyID=845289ca-16cc-4c73-8934-dd46b5ed1d33&displaylang=en.

 

Hope this helps!

Read More
Posted in | No comments

Wednesday, 25 June 2008

Decent online monitor calibration tool

Posted on 16:46 by Unknown

While I don't doubt that an external calibration tool is better for calibrating your monitor, I came across one online that yielded good results for my Dell 2009W 20" Wide Screen LCD's:  http://www.lagom.nl/lcd-test/

Read More
Posted in | No comments

Another MacBook hard drive bites the dust

Posted on 13:21 by Unknown

I've had my MacBook 2.16GHz for just under two years now, and I've just had to replace the hard drive for a second time (mind you, this time not under Apple's warrantee).

With most laptops, this would not be much of a surprise to me - after all, most laptops tend to take a beating, and this type of failure is somewhat normal.  The thing is, this laptop is used almost exclusively for testing; it sits on my desk 340 days of the year without moving - the power cord is tie wrapped to my desk even.

If my friends are reading this, they're probably thinking  "Steven is on one of his anti-Apple rants again," and while that might be partially true, the point I'm trying to make (or the myths I'm trying to dispel rather) is simple: MacBooks are not more reliable than Dell, HP, or Lenovo laptops.   They all use almost identical drives, mother boards, video cards and RAM (the RAM I pulled out of this recently was Samsung).

That being said, my experience with this particular MacBook is that it is actually significantly less reliable than other laptops I've owned.  My general feeling is that it suffers from a heat dissipation problem.  The vents on this unit are few and small, and under most of my use, the fan has to run at what seems to be full blast. When I compare this to similar Dell laptops that I've owned/used, they seem to have way better ventilation, and as a result, the fans seem to run less frequently.

Good thing new drives are cheap!

Read More
Posted in | No comments

Tuesday, 24 June 2008

Dell 2009W's Finally Arrive

Posted on 17:36 by Unknown

I had previously written about the new Dell 2208WFP 22" Wide Screen LCD's that I had purchased and immediately sent back due to their blinding brightness and poor colour quality.  After nearly a month of waiting, I finally received my 2 Dell 2009W 20" Wide Screen LCD's.  My Dell rep informed me that the delay was due to a warehouse changeover in the USA (whether I believe that or not is unimportant).

Now that I have my new panels, I thought I'd share a few thoughts about them.

First are foremost, they are a significant improvement over the 2208WFP's.  That being said, I don't feel that the colour quality is as good as the Dell 2007WFP's that I have at my office. Also, the colour noticeably changes with the viewing angle, and they look slightly washed out even dead on.  My overall opinion is that Dell is cranking the brightness of their panels to increase the advertised contrast ratio, with colour quality suffering as a result.  But for the price, you can't go too wrong, and the quality is still higher then a lot of panels on the market.

My biggest complaint so far is that the stands don't seem to go high enough.  At my office I have an Ergontron DS100 Dual Monitor Desk Stand that holds the monitors noticeably higher then the highest setting on the height adjustable stands they ship with.  I'm going to need to offset this with a screen platform (aka: phone book).

Overall rating: 3/5

Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • How to change the temperature scale on a Honeywell T6575 Thermostat
    [The complete documentation can be found at http://customer.honeywell.ca/techlit/pdf/95c-00000s/95c-10897.pdf ]   This was bugging me fo...
  • Why does iTunes setup need to close Outlook?!
    Everytime I update iTunes I remember why I left it so long - the install process is quite annoying! Can someone please explain to me why it...
  • Dell 2009W's Finally Arrive
    I had previously   written about the new Dell 2208WFP 22" Wide Screen LCD's that I had purchased and immediately sent back due to ...
  • Mac OSX 10.5.2 Freezing Intermittently
    I've been having an issue with my MacBook (you know, that computer I hide under my desk most of the time) where intermittently, the UI w...
  • Recursively finding controls - where to start?
    I love hearing about bugs and problems in components I have authored.  Most people hate hearing about bugs (I assume because they like to th...
  • ScottGu’s Color Scheme for Visual Studio 2010
    ScottGu was nice enough to provide the world with his awesome Visual Studio 2008 color scheme.  I’ve been using this for many years now an...
  • Windows Search 4.0 Released .....and searching finally works!
    I've been dealing with Outlook 2007's search problems since installing it way back then.  Most frequently, I'd search a keyword;...
  • How to query your BES database for a list of users
    I was asked to generate a list of all our BES users, including their name, phone number, PIN, IMEI and device number.  Sure, I could have co...
  • C# – Converting IP’s to Numbers and Numbers to IP’s in 2 lines of code
    I don’t know why everywhere I searched had such complex implementation of this, but converting from a dotted IP to a number (integer) and ba...
  • Using SQL PIVOT with non-aggregate column
    I was banging my head on my desk for a while over this one, hopefully this will save you the pain… I wanted to use SQL 2005’s PIVOT functi...

Blog Archive

  • ▼  2012 (1)
    • ▼  February (1)
      • An Experiment with Google Services & Page Speed
  • ►  2010 (1)
    • ►  April (1)
  • ►  2009 (7)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  July (1)
    • ►  April (2)
    • ►  February (1)
  • ►  2008 (36)
    • ►  November (3)
    • ►  October (2)
    • ►  September (1)
    • ►  August (1)
    • ►  July (2)
    • ►  June (6)
    • ►  May (4)
    • ►  April (1)
    • ►  March (4)
    • ►  February (7)
    • ►  January (5)
  • ►  2007 (35)
    • ►  December (1)
    • ►  November (9)
    • ►  October (3)
    • ►  September (6)
    • ►  August (7)
    • ►  July (9)
  • ►  2006 (3)
    • ►  May (3)
Powered by Blogger.

About Me

Unknown
View my complete profile