Disabling buttons/lists/etc when executing ASP.NET AJAX request

Just drop it in your page before the </body> tag:

    <script language="javascript" type="text/javascript">
        var prm = Sys.WebForms.PageRequestManager.getInstance();


        var oldClass = "";
        function InitializeRequest(sender, args) {
            var postBackElement = $get(args._postBackElement.id);
            if (postBackElement != null) {
                postBackElement.disabled = true;
                oldClass = postBackElement.className;
                postBackElement.className = postBackElement.className + " disabled";
        function EndRequest(sender, args) {
            var sourceElement = $get(sender._postBackSettings.sourceElement.id);
            if (sourceElement != null) {
                sourceElement.disabled = false;
                sourceElement.className = oldClass;
            oldClass = "";

And add this to your CSS (you may differentiate this among various tags like img.disabled for imagebuttons or input.disabled for textboxes etc.):

    FILTER: alpha(opacity=70);
    opacity: 0.7

Just be carefull if you change the class of the element in question (that originated the ajax postback) to register a client script block to set oldClass to the new value as well, otherways it would be overwritten.

Streaming server and ASX

At one my clients occured the problem of all videos being played 3 times 3 times 3 times instead of just one.

After some investigation, it turned out, that for each request coming for a WMV file instead of an ASX file is returned. For example, for a request for http://stream/stream.wmv the following asx was generated:

<asx version="3.0">
    <ref href="http://stream3/stream.wmv" />
    <copyright>(c) 2008 stream</copyright>
    <ref href="http://stream1/stream.wmv" />
    <copyright>(c) 2008 stream</copyright>
    <ref href="http://stream2/stream.wmv" />
    <copyright>(c) 2008 stream</copyright>

If you read the specification for the ASX file format, this should/may be rewritten as:

      <REF HREF="http://stream3/stream.wmv" />
      <REF HREF="http://stream1/stream.wmv" />
      <REF HREF="http://stream2/stream.wmv" />
      <COPYRIGHT>(c) 2008 stream</COPYRIGHT>

This would instead of playing the three items after each other just choose the first one, that responds in a timely fashion from the list. The day is saved, the roundrobin load balancing still works as it should, and nothing plays three times three times three times.