.Net Framework basic Concepts


If you are new to .net technology or even though you are working with .net technology, but you are not knowing the basic of .net technology then this article will help you to understand the all basic concept of .net technology.

If you are attaining any interview and you are not knowing the basic of .net framework then obviously they will reject you. So it is very important to understand the basis concept of .net.


So what is the .net Framework??

.net framework is the software which is developed by Microsoft for creating different type of application software.

What is the platforms?

>> Platform is the set of resource which will help to perform some particular task like Railways platforms will provide the set of resource to come the passenger and travel from source to destination location. It provide all type of facilities for passenger and train. For train, it will also provide the electricity, water, signal, platform number to halt. These all are the essential resource to keep the train running.

Is the .net can called as platform?

>> Yes we can call it as platform since it will provide all suitable environment to run any .net application.

Is the .net is platform independent?

Initially it was not a platform independent. It was developed to work only on window OS. But now it is the platform independent. It will work on all type of environment like window, Mac, Linux etc.

What are the main component of .Net Framework?

Main component of .net Framework is CLR, CTS, CLS and FCL
CLR (Common Language Runtime)
CTS (Common Type System)
CLS (Common Language Specification)
FCL (Framework Class Library)

net_fw

What is the CLR?

CLR is the common language runtime. It is the heart of .net framework. It performs the following task
1. Garbage collection
2. Code access security
3. Code verification
4. IL to Native code.

What is the CLS ?

CLS is the Common Language Specification. It is the set of rules and guideline to make any language to be execute on .Net Framework.

What is the CTS?

CTS is the Common Type System. It makes ensure that all data type defined in two language get compiled to common data type. It makes the smooth communication between all .net aware languages.

What is the FCL?

FCL is the framework class library. It is collection of reusable classes, interfaces and Value type. It is common for all .net aware languages. It is also called as base class library.

What is the garbage collector?

It is the process of cleaning the unused memory from the application. But it doesn’t clean unmanaged objects. Before .net there were not the concept of garbage collection in vb 6. Developer has to manually write the code for cleaning the unused memory from application.

Garbage collector process happen in 3 generations. Generation define the age of object
a. Generation 0
b. Generation 1
c. Generation 2

Generation 0: When the application create the fresh objects they are marked as Generation 0.

Generation 1: When the Garbage collector is not able to clear the Gen 0 in the first round, it will move to them to Gen 1 bucket.

Generation 2: When the Garbage collector is not able to clear the Gen 1 object, again it will move to them to Gen 2 bucket.

Generation are created to improve the performance of Garbage collector. Garbage collector spend more time on Gen 0 rather than Gen 1 and 2.

Code execution on .net F/w

codeexec

.Net Framework History

• In 2002 ( .NET Framework 1.0) Visual Studio.net
• In 2003 (.NET Framework 1.1) Visual Studio 2003
• In 2005 (.NET Framework 2.0) Visual Studio 2005
• In 2006 (.NET Framework 3.0) Visual Studio 2005
• In 2007 (.NET Framework 3.5) Visual Studio 2008
• In 2010 (.NET Framework 4.0) Visual Studio 2010
• In 2012 (.NET Framework 4.5) Visual Studio 2012
• In 2013 (.NET Framework 4.5.1) Visual Studio 2013
• In 2015 (.NET Framework 4.6) Visual Studio 2015

Key features of each .net framework

.Net Framework 1.0

• DLL Library
• Support for object oriented web app dev
• Managed code (Code which run under CLR)
• Garbage collection functionality

.Net Framework 1.1

• It came with Visual Studio 2003
• Enhancement in asp.net and ado.net
• Support for mobile asp.net controls
• Security enhancement for Asp.net
• Support for ODBC and Other database
• Support for IPV6(Internet Protocol Version 6)
• .NET Compact Framework for Small device.

.Net Framework 2.0

It came with VS 2005
– Generics
– Generic collections
– Partial class
– Nullable types
– Anonymous methods
– Data tables
– Membership providers
– New controls and features for ASP.NET
– Support for 64-bit computing
– Microsoft SQL Server integration

.Net Framework 3.0

• WPF (Windows Presentation Foundation
• WCF (Windows Communication Foundation )
• WWF (Windows Workflow Foundation)
• Windows CardSpace


.Net Framework 3.5

• It came with Visual Studio 2008
• LINQ
• Dynamic Data
• Ajax Support
• Multi Targeting Framework

.Net Framework 4.0

• It came with Visual Studio 2010
• Task Parallel Library
• Dynamic Language Runtime(DLR)
• Managed Extensibility Framework(MEF)
• CLR 4.0

.Net Framework 4.5
• It came with Visual Studio 2012
• CLR 4.0 enhanced
• Built-in support to Async
• Support for Windows Store (Metro) app dev
• WPF, WCF, WWF enhanced
• ASP.NET support enhanced
• Native support for Zip compression

.NET Framework 4.5.1
• Came with Visual Studio 2013
• Support for automatic binding redirection
• Improvements towards performance, debugging
• Expanded support for Windows Store app dev

.NET Framework 4.6
• Came with Visual Studio 2015
• A new JIT compiler named RyuJIT for 64-bit
• Support for code page encodings
• Open source .NET framework packages
• Event tracing improvements
• Support for TLS 1.1 and TLS 1.2

What type of application can we developed using .net framework?

• Window Form application
• Web application
• Mobile Application
• Services Component
• Game Development
• Wearable device software development

Summary

I hope that in this article you will be aware of all basic concepts of.net framework. Please let me share your suggestion.

Unable to access the IIS metabase


Hi

Today while working on one of my project, i was getting exception like given below.

Unable to access the IIS metabase.You do not have sufficient privilege to access IIS web sites on your machine

metadata_error

I found the two possible approach to fix this issue

1. Run the visual studio as “administrator Mode”

2. Permanently grant the IIS Metabase folder permissions to the current user.

First approach is straight forward, while for the second approach we have to go the given path

%systemroot%\System32\inetsrv\config

For this we have to do Win + E then Paste the given path in top address bar.

You will get the window like this

access

You click on “Continue” button. Now reload the project from Visual you will not get the above exception.

HTTP Error 403.14 – Forbidden The Web server is configured to not list the contents


While hosting the asp.net or asp.net MVC application on IIS, you might have faced this exception on browser
“HTTP Error 403.14 – Forbidden The Web server is configured to not list the contents”

To fix this issue, you might have to check the two possible setting in IIS

First: Make sure that the .NET Framework version value is v4.0.

iis_error1

For this you have to do like this

1. Open the Run dialog, type inetmgr and then click OK. This opens the IIS Manager.

2. In the left tree-view, locate the Sites node and find the Default Web Site node under it (or the name of the site where the error message appears).

3 Right-click the node and select Manage web site -> Advanced settings…. Note the name of the value Application pool. Close this dialog.

4. In the treeview to the left, locate and select the node Application pools.

5. In the list to the right, locate the Application pool with the same name as the one you noted in the web site settings. Right-click it and select Advanced settings

6. Make sure that the .NET Framework version value is v4.0. Click OK.


Second: Asp.net is not registered on Server

For this you have to go to
>>Visual Studio
>> Then Visual Studio Tool >> Visual Studio Command Prompt

>> Then Go to the given path C:\Windows\Microsoft.NET\Framework64\v4.0.30319
>> Then run the aspnet_regiis.exe -ir

iis_error

Learn Jquery with in 15 hrs

Posted in Jquery. Tags: . Leave a Comment »

Jquery Ajax in Asp.net MVC (Part 16)


In this post i will show you how to use Jquery Ajax method in Asp.net MVC. This topic is very vast but I will create very simple example to test this method in asp.net MVC.

calling_jquey_ajax

Step 1: Create one blank asp.net MVC application. I hope you are knowing the basic concept of asp.net MVC.

Step 2: Create Emp Class in Model folder and write the code like this

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AjaxDemoInMVC.Models
{
    public class Emp
    {
        public int Id { get; set; }
        public string EmpName { get; set; }
        public string EmpAddress { get; set; }
    }
}

Step 3: Create the HomeController and the DisplayEmpDetail Method like this


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AjaxDemoInMVC.Models;

namespace AjaxDemoInMVC.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public JsonResult DisplayEmpDetail(int id)
        {
            Emp obj = new Emp
            {
                 Id=id,
                 EmpName="Chandradev",
                 EmpAddress="Bangalore"
            };
            return Json(obj);
        }
    }
}

Note: Here we are returning the values as Json format.

Step 4: Create the Index view and Write the code for calling the method using Jquery Ajax method as given below


@model AjaxDemoInMVC.Models.Emp

@{
    ViewBag.Title = "Index";
}

<fieldset>
    <legend>
        Sample code for Calling Jquery Ajax in asp.net MVC
    </legend>

    <br />

EmpId: <input type="text" id="txtId" />
<input type="button" id="btnAjax"  value="Click Here to Call Jquery Ajax" />
</fieldset>
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script>
    $(function () {
        $("#btnAjax").click(function () {
            $.ajax({
                type: "POST",
                url: "Home/DisplayEmpDetail",
                data: '{Id: "' + $("#txtId").val() + '" }',
                contentType: "application/json; charset=utf-8",
                success: function (response) {
                    alert("EmpName: "+ response.EmpName + "   EmpAddress: " + response.EmpAddress);
                },
                failure: function (response) {
                    alert(response.responseText);
                },
                error: function (response) {
                    alert(response.responseText);
                }

            });

        });

    });
</script>

Note : In the above code we show that we are using jquery Ajax method on button Click event and Ajax method expect the type, URL,Data,ContentType,Success,Failure and error parameter.

Type: means Type of Request in Ajax method

URL: Means Method name which are using for Ajax functionality.

data: what are the input data being used in method

ContentType: What are the content type consuming in Ajax method. We are giving data in Json format in DisplayEmpDetail Method.

success: What will return the method on successfully execution.

failure: It will define what message should be display on failure of Ajax method
error: It will display the error message.

Summary: We show that how to use Jquery Ajax method in asp.net MVC application.

Ajax in Jquery (Part 15)


If you are the web developer and you are not using ajax functionalities in your web application then you are missing one of the cool features of web technology.

What is the ajax ?

Ajax is the asynchronous JavaScript with xml. which is used for doing the asynchronous communication between client and server. It will avoid unnecessary round trip between client and server so it will give good performance as compare to old technology.

Ajax is one of the important concept of jquery library. Using ajax in jquery we can create very interactive and light weight web web application.
Jquery library provide the 5 methods for doing the ajax functionalities. These as given below
1. Load
2. getjson
3. GET
4. POST
5. Ajax

In this post, i will include some of the important methods which are being used frequently

Load:

Load method is used to load the data from a server and put the data in the given selected area.

load_method

Step 1: Create one notepad text file and keep some dummy text data on it. I have created Test.txt and kept in the parent folder.

Step 2: Write the code for calling the “Test.txt” file in given Div as given below


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../../Scripts/jquery.min.js"></script>
    <style>
        .bckColor {
            background-color:silver;
        }
        
    </style>
    <script>
        $(function () {
            $("button").click(function () {

                $("#div1").load("Test.txt");
            });

        });
    </script>
</head>
<body>
    <fieldset>
        <legend>
            Sample code for calling load method in Jquery.
        </legend>
       <div id="div1"></div>
       <button>Click Here</button>
     </fieldset>
</body>
</html>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>

</body>
</html>

Summary :

In the above example we show that Load method is used to load the notepad text document in the given div area in asynchronous way.

Posted in Jquery. 1 Comment »

Filter and Find method in Jquery Traversing (Part 14)


This is one of the very important question in interview. I have got this question each and every interview. So i decided to write one small article on this question.

Filter(Selector):

This method is used to search the element in entire DOM element.

filter

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../../Scripts/jquery.min.js"></script>
    <style>
        .bckColor {
            background-color: silver;
        }
    </style>
    <script>
        $(function () {
            $("div").filter(".bckColor").css("background-color", "green");

        });
    </script>
</head>
<body>
    <fieldset>
        <legend>Sample code for filter in Jquery
        </legend>
        <div class="bckColor">
            Parent Div
           <div class="bckColor">
               Child Div
           <p>
               This is the paragraph
           </p>
           </div>
        </div>
    </fieldset>
</body>
</html>

In the above example we saw that background of div element is being changed on basis of filter(selector). Filter(Selector) method is searching the element in entire DOM element.

Find(Selector):

Find method is used to search the element in only child DOM element.

find

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../../Scripts/jquery.min.js"></script>
    <style>
        .bckColor {
            background-color:silver;
        }
        
    </style>
    <script>
        $(function () {
            $("div").find(".bckColor").css("background-color", "green");

        });
    </script>
</head>
<body>
    <fieldset>
        <legend>
            Sample code for find in Jquery
        </legend>
       <div class="bckColor"> Parent Div
           <div class="bckColor"> Child Div
           <p>
               This is the paragraph
           </p>
           </div>
       </div>
     </fieldset>
</body>
</html>

In the above example we saw that find(selector) is searching the element in only child DOM element.

Summary:

In the both example we saw that filter is used for searching the element in entire DOM element while Find method is used for searching element on child DOM element.

Posted in Jquery. 1 Comment »