10 December 2013

Explaining about .NET Uses?

.NET is an object-oriented programming (OOP) model introduced to help developers create Internet-based distributed systems. It provides a platform-independent framework that enables developers to quickly build, deploy, and manage Web-based applications, smart client applications, and XML Web services applications. The platform-independence feature enables businesses to quickly integrate their systems, information, and devices, thereby helping users collaborate and communicate effectively.

Lets know about Few Technologies Before discussing of .NET Uses.They are

COM and DNA :
      Before the development of .NET, COM and DNA technologies were used for application development on Microsoft platforms. COM is Microsoft’s framework for developing and supporting program component objects. DNA is a framework that integrates Web applications with the n-tier model of development. It is used to develop cost-effective solutions that can meet the demands of the Internet, intranet, global e-commerce, and corporate computing.

Drawbacks of Pre .NET Technologies
                         Programmers mostly used Microsoft Visual Basic (VB) and Microsoft Visual C++ (VC++) for developing applications using the COM/DNA technologies. However, these technologies and the programming languages had several drawbacks.

Limitations of VC++ in COM/DNA Applications
                         The other language used by programmers to work with COM and DNA applications was VC++. However, VC++ is a complex language. It has too many data types. Additionally, exchange of data between different layers was difficult because of data type compatibility issues. To resolve such issues, developers had to be familiar with various libraries, such as Software Development Kit (SDK), Microsoft Foundation Class (MFC), Active Template Library (ATL), and COM.

Drawbacks of COM/DNA :
                          Apart from the limitations resulting from VB and VC++, the COM/DNA technologies had several other drawbacks. These drawbacks became apparent as these technologies were extended into larger enterprise-level settings and as integration with the Internet became necessary. Some such drawbacks of COM/DNA technologies included difficulty in integrating Internet technologies, difficulty in side-by-side execution of components, and deployment issues.

Difficulty in Integrating Internet Technologies
The growth of the Internet has lead to the need of a tool for developing Internet-based technologies. To address this need, Microsoft developed ASP. However, ASP was not meant for structured and object-oriented development. It was also difficult to design, debug, and maintain ASP code.
The existing technologies lacked the ability to communicate with users through HyperText Transfer Protocol (HTTP) and HyperText Markup Language (HTML). Developers required a standard that could enable processes to communicate over the Internet. However, COM and DNA did not provide any such standard.

Difficulty in Side-by-Side Execution of Components
With DNA, it is difficult to have side-by-side execution of components. In side-by-side execution of components, different versions of a component can coexist and run simultaneously on the same machine and within the same process.
When a new application is installed with DNA, it overwrites the existing version of the shared component with a new version of the component. Usually, the new version is not backward-compatible with the existing applications. Therefore, though the new application works, existing applications that depend on the old version start functioning incorrectly or stop functioning completely.

COM and Deployment
                                COM components are difficult to deploy. The COM standard was developed for use on systems having limited memory and was designed with a focus on memory sharing between applications. The Dynamic Link Libraries (DLLs) on such systems were shared between applications to save memory.

Deployment Issues
                             The process of sharing DLLs between applications resulted in several deployment issues. DLLs had to be registered in the local Windows Registry so that components required to run an application could be located quickly. This resulted in other limitations. For instance, you could not place a COM application on a CD-ROM or a network drive and then run it from that location without an installation procedure.

4 December 2013

How to Create a Textarea Character Counter(or)Limiter Using jQuery?

Creating a textarea character couter using jQuery is pretty easy.

To implement this we need to write the code like as shown below.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestOCRReader.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var characterLimit = 140;
        $(document).ready(function () {
            $("#lblremaingCharacters").html(characterLimit);
            $("#meTextarea").bind("keyup", function () {
                var characterInserted = $(this).val().length;
                if (characterInserted > characterLimit) {
                    $(this).val($(this).val().substr(0, characterLimit));
                }
                var characterRemaining = characterLimit - characterInserted;
                $("#lblremaingCharacters").html(characterRemaining);
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <label id="lblremaingCharacters" style="color:Red;font-weight:bold"></label><label> characters remaining.</label><br />
    <textarea id="meTextarea"></textarea>
    </div>
    </form>
</body>
</html>

Result as shown below :


Page Life Cycle in ASP.NET

In this post, we will understand the Page Life Cycle in ASp.Net. It is very important to understand the Page Life Cycle in Asp.Net for many reasons, mainly for understanding where we can place particular methods and set page properties efficiently.
Before I start the explanation of Page Life Cycle, here I explain some important resources which uses on page request:-

Internet Information Server (IIS) - IIS is the default web server in Microsoft .Net. It helps to deploy web sites/ web applications. IIS receives request for a web resource (file) and check the extension of the file (.aspx, .ashx, .asmx etc) and determines which HTTP handler will handle this request and send the request to proper handlers.

ASPNET_ISAPI.DLL- IIS loads this DLL and send request to this DLL. This DLL loads the HTTP Runtime for further processing.

ASPNET_WP.EXE- It contains an application pool. Each Application Pool can contain any number of Applications. Application Pool is also called as AppDomain. When a web page is requested, IIS looks for the application pool under which the current application is running and forwards the request to the respective worker process.

PAGE LIFE CYCLE :

When an ASP.Net page runs, it goes through several processing steps which called the Page Life Cycle in simple words. Mainly Page life depends on the fact that whether the page is requested first time or after the Post back (page request of itself).

Page Life Cycle Stages :
There are application stages that occur before and after a request but are not specific to a page.
 The stages are:-
1.Page Request: - Page Request occurs before page life cycle begins. When user requested the page, ASP.Net determines that the page is needed to be parsed and compiled or whether a cached version of the page can be sent in response without running the page.

2.Start: - In the start stage, page properties such as Request and Response is set. At this stage, page also determines that request is post back or a new request and sets the IsPostBack property.

3.Page Initialization: - During page initialization, controls on the page are available and each control’s UniqueID property is set. A master page and themes are also applied to the page if applicable. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.

4. Load: - During Load, if the current request is postback, control properties are loaded with information recovered from view state.

5.Validation: - During validation, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page.

6.Postback Event Handling: - If the request is a postback, any event handlers are called. The event handling for server controls occurs during this stage.

7.Rendering Unload: - Before rendering, view state is saved for the page and all controls. During the rendering stage, the page calls the Render method for each control, providing a text writer that writes its output to the OutPutStream object of the page's Response property.

2 December 2013

Explaining about Cloud Computing and Benefits..?


What is Cloud Computing?
                      At its simplest, cloud computing is the dynamic delivery of information technology resources and capabilities as a service over the Internet.

Cloud computing is a style of computing in which dynamically scalable and often virtualized resources are provided as a service over the Internet. It generally incorporates infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (SaaS).    

The attributes of cloud computing are:
Service-based
Scalable and elastic
Shared
Metered by use
Use of Internet technologies.

Advantages of .Net Framework

The .Net Framework offers a number of advantages to developers..They are

1) Consistent programming model
2) Direct Support for Security
3) Simplified Development efforts
4) Easy application deployment and Maintenance
5) Assemblies

1)Consistent programming model :
                                     With .Net accessing data with a C# and VB.Net very similar apart from slight syntactical differences. Both the programs need to import the System.Data namespace, both programs establish connection with database and both programs run a query and display the data.
2)Direct Support for Security : 
                                    .Net framework enables the developer and the system administrator to specify method level security.
3)Simplified Development efforts:
                                    The .Net Framework simplifies debugging with support for Run-time diagnostics.
4)Easy application deployment and Maintenance :
                                    The .Net Framework makes easy to deploy applications. The .Net Framework handles the details of locating and loads the components.
5)Assemblies :
                                    Assembly is elementary unit in a framework application. It performs various functions in programming with the .Net Frame work. Every computer that has the .Net Framework installed with have the Global Assembly Cache.