Category Archives: AjaxControlToolkit

.Net Data Design Stratagies

While designing an application to design a data layer or connecting to database there are multiple options:
1. ADO.Net: This the old way of connecting to the data base, creating a connection and binding the data to dataset or datatable and updating or reading the data from database.
2. Entity Framework: Entity Framework is inbuit of .net framework now and it’s a abstract way of connecting to the database and better way for the developers who are not entirely familiar with the database programming. Database is not entirely object oriented like the way the objects are in .net like inheritance so orm tools like Entity Framework maps the relational objects to object oriented entities for the developers to directly interact with the data as objects. Similarly, Entity Framework can map the objects or entities creates in .net and map to relational objects like Code first methodology.

3. WCF Services: .Net Framework version 3.0 introduced WCF as to combine and update several communication technologies like enterprise services, Active Server Methods (ASMX) webservices, Web Service Extensions (WSE), Microsoft Message Queuing (MSMQ) and .Net remoting. WCF web services is the most powerful, flexible, and secure way to provide Application Logic layer services to a Presentation Layer, whether the presentation Layer is part of the same application or different one.

4. WCF Data Services: It was formerly known as ADO.Net Data Services. It allows you to quickly build an OData or REST service. OData or REST are HTTP based open standards for exposing data across the web, where they can be consumed by clients built on a wide variety of platforms, including .Net, Microsoft Silverlight, JQuery, PHP and Javascript.

You can get into a dilemma to choose the correct methodology or framework for data design, below are the few scenarios where we can categorize each with:

Choose Entity Framework when you
–implementing the Data Layer
–connect to the database without network protocol restriction
–require rapid application development
–require strongly typed objects.
Choose WCF Data Services when you are
–implementing the Data Layer
–Connect to the database server by using HTTP
–require access from javascript
–require application level control over access to the data.
Choose WCF web services when you are
–implementing the Application Logic layer
–require specific network protocols, such as WS-Security, SOAP or REST
–require multiple binding types for different clients
–require access from Javascript
Choose ASMX web services when you are
–implementing either Application Logic or Data Layer for a remote application
–need to add web services to an existing ASP.Net application
–will host the application only on IIS
–require only basic HTTP communication.

Could not set focus on the invisible object – AjaxControlToolkit

Recently when we updated our AjaxControlToolkit library, strangely it was giving an “Could not set focus on the invisible Object” error on some machines. When I debugged it, the error raised with the tab panel. The same code is working fine with the older AjaxControlToolkit library version. But we modified our pages to suit the latest version so we had to tweek the current version js function. The developers of AjaxControlToolkit have added a method to set focus on the tab panels. The following code resolved the issue..

        //To resolve an error(set focus) with the current AjaxControlToolkit version (4.1.51116.0)
        if (Sys.Extended.UI.TabPanel != 'undefined' && Sys.Extended.UI.TabPanel) {
            Sys.Extended.UI.TabPanel.prototype._setFocus = function (a) {
                var x = $get("__tab_" + a.get_element().id);
                if (x.hidden == false && != 'hidden' && != 'none')