• .NET Mobile

    Don't Use BODY ONLOAD in ASP.NET AJAX Websites

    In the past developers used <body onload="..."> to execute some script as soon as the page is loaded. Nowadays this is rather old-fashioned, no matter how you look at it. What's more, it doesn't work as expected in ASP.NET AJAX websites. Consider the following example:   <body onload="MyFunction()">    <script type="text/javascript">       function MyFunction()     {        var myAjaxControl = $find("myAjaxControlClientID");        myAjaxControl.doSomething();     }    </script>    </body>    The client-side page load event is fired by the browser as soon as all HTML and scripts have been loaded. However, this happens before the controls' client-side instances have been created. As a result, myAjaxControl will be null and the doSomething() method will trigger a Javascript error. So, a lot better approach...
    December 13, 2008
  • .NET Mobile

    Taming Ajaxified asp:HiddenField Controls in Internet Explorer

    If you are using asp:HiddenField controls (rendered as <input type="hidden" />) in your website and update their values with AJAX requests, you may observe some unexpected changes in the page layout in Internet Explorer (IE). It will seem that an empty line is inserted at each location where a HiddenField control resides. The behavior is observed only in IE and looks like a problem caused by the browser or the MS AJAX client-side framework. A quite easy workaround for this glitch is to wrap the HiddenField in a container with no height and reduced font size. Here is an...
    December 09, 2008
  • .NET Mobile

    Image Centering Techniques You Should Know About

    The following new code library entry demonstrates two alternative techniques for centering an image inside a RadAjaxLoadingPanel. Both techniques should not be something new for CSS-savvy devs, however, we receive queries for them from time to time, so it will be good to have an example available online: How to Center Image In a RadAjaxLoadingPanel  ...
    November 18, 2008
  • .NET

    ASP.NET binding with OpenAccessDataSource

    In the last post we saw how easy it is to reverse engineer a database schema. Let's now use the resulting persistent classes library to build the first website. Let's do it again step by step: Step 1: Use the resulting solution from the northwind reverse engineering post. Step 2: Add a new web application by execution File->Add->New Web Site... from the Visual Studio Menu. Choose ASP.NET Web Site. Step 3: Add a reference from the website to the class library. Select the website project in the Solution Explorer and execute Website->Add reference from the Visual Studio Menu. Select the class library project in the Projects tab.   All...
    November 15, 2008
  • .NET Mobile

    Optimized Rendering and Skins for RadCalendar for ASP.NET AJAX

    I have the pleasure to announce that RadCalendar for ASP.NET AJAX has undergone a considerable HTML and CSS optimization. As a result, the HTML output generated by the following RadCalendar declaration has dropped from 5,916 bytes to 3,905 bytes, or by...
    October 14, 2008