Monday 29 February 2016

The Five Stages of Team Development: A Case Study


The Five Stages of Team Development: A Case Study







Sticky notes on a cork board showing the stages of team development

Every team goes through the five stages of team development. First, some background on team development. The first four stages of team growth were first developed by Bruce Wayne Tuckman and published in 1965.His theory, called "Tuckman's Stages" was based on research he conducted on team dynamics. He believed (as is a common belief today) that these stages are inevitable in order for a team to grow to the point where they are functioning effectively together and delivering high quality results.
In 1977, Tuckman, jointly with Mary Ann Jensen, added a fifth stage to the 4 stages: "Adjourning." The adjourning stage is when the team is completing the current project. They will be joining other teams and moving on to other work in the near future. For a high performing team, the end of a project brings on feelings of sadness as the team members have effectively become as one and now are going their separate ways.
The five stages:
  • Stage 1: Forming
  • Stage 2: Storming
  • Stage 3: Norming
  • Stage 4: Performing
  • Stage 5: Adjourning
This article provides background on each stage and an example of a team going through all five stages.

Stage 1: Forming

The "forming" stage takes place when the team first meets each other. In this first meeting, team members are introduced to each. They share information about their backgrounds, interests and experience and form first impressions of each other. They learn about the project they will be working on, discuss the project's objectives/goals and start to think about what role they will play on the project team. They are not yet working on the project. They are, effectively, "feeling each other out" and finding their way around how they might work together.
During this initial stage of team growth, it is important for the team leader to be very clear about team goals and provide clear direction regarding the project. The team leader should ensure that all of the members are involved in determining team roles and responsibilities and should work with the team to help them establish how they will work together ("team norms"). The team is dependent on the team leader to guide them.

Stage 2: Storming

As the team begins to work together, they move into the "storming" stage. This stage is not avoidable; every team - most especially a new team who has never worked together before - goes through this part of developing as a team. In this stage, the team members compete with each other for status and for acceptance of their ideas. They have different opinions on what should be done and how it should be done - which causes conflict within the team. As they go progress through this stage, with the guidance of the team leader, they learn how to solve problems together, function both independently and together as a team, and settle into roles and responsibilities on the team. For team members who do not like conflict, this is a difficult stage to go through.
The team leader needs to be adept at facilitating the team through this stage - ensuring the team members learn to listen to each other and respect their differences and ideas. This includes not allowing any one team member to control all conversations and to facilitate contributions from all members of the team. The team leader will need to coach some team members to be more assertive and other team members on how to be more effective listeners.
This stage will come to a closure when the team becomes more accepting of each other and learns how to work together for the good of the project. At this point, the team leader should start transitioning some decision making to the team to allow them more independence, but still stay involved to resolve any conflicts as quickly as possible.
Some teams, however, do not move beyond this stage and the entire project is spent in conflict and low morale and motivation, making it difficult to get the project completed. Usually teams comprised of members who are professionally immature will have a difficult time getting past this stage.

Stage 3: Norming

When the team moves into the "norming" stage, they are beginning to work more effectively as a team. They are no longer focused on their individual goals, but rather are focused on developing a way of working together (processes and procedures). They respect each other's opinions and value their differences. They begin to see the value in those differences on the team. Working together as a team seems more natural. In this stage, the team has agreed on their team rules for working together, how they will share information and resolve team conflict, and what tools and processes they will use to get the job done. The team members begin to trust each other and actively seek each other out for assistance and input. Rather than compete against each other, they are now helping each other to work toward a common goal. The team members also start to make significant progress on the project as they begin working together more effectively.
In this stage, the team leader may not be as involved in decision making and problem solving since the team members are working better together and can take on more responsibility in these areas. The team has greater self-direction and is able to resolve issues and conflict as a group. On occasion, however, the team leader may step in to move things along if the team gets stuck. The team leader should always ensure that the team members are working collaboratively and may begin to function as a coach to the members of the team.

Stage 4: Performing

In the "performing" stage, teams are functioning at a very high level. The focus is on reaching the goal as a group. The team members have gotten to know each other, trust each other and rely on each other.
Not every team makes it to this level of team growth; some teams stop at Stage 3: Norming. The highly performing team functions without oversight and the members have become interdependent. The team is highly motivated to get the job done. They can make decisions and problem solve quickly and effectively. When they disagree, the team members can work through it and come to consensus without interrupting the project's progress. If there needs to be a change in team processes - the team will come to agreement on changing processes on their own without reliance on the team leader.
In this stage, the team leader is not involved in decision making, problem solving or other such activities involving the day-to-day work of the team. The team members work effectively as a group and do not need the oversight that is required at the other stages. The team leader will continue to monitor the progress of the team and celebrate milestone achievements with the team to continue to build team camaraderie. The team leader will also serve as the gateway when decisions need to be reached at a higher level within the organisation.
Even in this stage, there is a possibility that the team may revert back to another stage. For example, it is possible for the team to revert back to the "storming" stage if one of the members starts working independently. Or, the team could revert back to the "forming" stage if a new member joins the team. If there are significant changes that throw a wrench into the works, it is possible for the team to revert back to an earlier stage until they are able to manage through the change.

Stage 5: Adjourning

In the "adjourning" stage the project is coming to an end and the team members are moving off into different directions. This stage looks at the team from the perspective of the well-being of the team rather than from the perspective of managing a team through the original four stages of team growth.
The team leader should ensure that there is time for the team to celebrate the success of the project and capture best practices for future use. (Or, if it was not a successful project - to evaluate what happened and capture lessons learned for future projects). This also provides the team the opportunity to say good-bye to each other and wish each other luck as they pursue their next endeavour. It is likely that any group that reached Stage 4: Performing will keep in touch with each other as they have become a very close knit group and there will be sadness at separating and moving on to other projects independently.

Is the Team Effective or Not?

There are various indicators of whether a team is working effectively together as a group. The characteristics of effective, successful teams include:
  • Clear communication among all members
  • Regular brainstorming session with all members participating
  • Consensus among team members
  • Problem solving done by the group
  • Commitment to the project and the other team members
  • Regular team meetings are effective and inclusive
  • Timely hand off from team members to others to ensure the project keeps moving in the right direction
  • Positive, supportive working relationships among all team members
Teams that are not working effectively together will display the characteristics listed below. The team leader will need to be actively involved with such teams. The sooner the team leader addresses issues and helps the team move to a more effective way of working together, the more likely the project is to end successfully.
  • Lack of communication among team members
  • No clear roles and responsibilities for team members
  • Team members "throw work over the wall" to other team members, with lack of concern for timelines or work quality
  • Team members work alone, rarely sharing information and offering assistance
  • Team members blame others for what goes wrong, no one accepts responsibility
  • Team members do not support others on the team
  • Team members are frequently absent thereby causing slippage in the timeline and additional work for their team members

Example of a Team Moving Through the Five Stages

Background and Team Members

A team has been pulled together from various parts of a large service organisation to work on a new process improvement project that is needed to improve how the company manages and supports its client base. The team lead on this project is Sandra from the Chicago office who has 15 years experience as a project manager/team lead managing process improvement projects.
The other members of the team include:
  • Peter: 10 years experience on various types of projects, expertise in scheduling and budget control (office location: San Diego)
  • Sarah: 5 years experience as an individual contributor on projects, strong programming background, some experience developing databases (office location: Chicago)
  • Mohammed: 8 years experience working on various projects, expertise in earned value management, stakeholder analysis and problem solving (office location: New York)
  • Donna: 2 years experience as an individual contributor on projects (office location: New York)
  • Ameya: 7 years experience on process improvement projects, background in developing databases, expertise in earned value management (office location: San Diego)
Sandra has worked on projects with Sarah and Mohammed, but has never worked with the others. Donna has worked with Mohammed. No one else has worked with other members of this team. Sandra has been given a very tight deadline to get this project completed.
Sandra has decided that it would be best if the team met face-to-face initially, even though they will be working virtually for the project. She has arranged a meeting at the New York office (company headquarters) for the entire team. They will spend 2 days getting introduced to each other and learning about the project.

The Initial Meeting (Stage 1: Forming)

The day of the face-to-face meeting in New York has arrived. All team members are present. The agenda includes:
  • Personal introductions
  • Team building exercises
  • Information about the process improvement project
  • Discussion around team roles and responsibilities
  • Discussion around team norms for working together
  • Introduction on how to use the SharePoint site that will be used for this project to share ideas, brainstorm, store project documentation, etc
The team members are very excited to meet each other. Each of them has heard of one another, although they have not worked together as a team before. They believe they each bring value to this project. The team building exercises have gone well; everyone participated and seemed to enjoy the exercises. While there was some discussion around roles and responsibilities - with team members vying for "key" positions on the team - overall there was agreement on what needed to get done and who was responsible for particular components of the project.
The onsite meeting is going well. The team members are getting to know each other and have been discussing their personal lives outside of work - hobbies, family, etc. Sandra is thinking that this is a great sign that they will get along well - they are engaged with each other and genuinely seem to like each other!

The Project Work Begins (Stage 2: Storming)

The team members have gone back to their home offices and are beginning work on their project. They are interacting via the SharePoint site and the project is off to a good start. And then the arguments begin.
Peter has put up the project schedule based on conversations with only Mohammed and Ameya on the team. Donna and Sarah feel as if their input to the schedule was not considered. They believe because they are more junior on the team, Peter has completely disregarded their concerns about the timeline for the project. They challenged Peter's schedule, stating that it was impossible to achieve and was setting up the team for failure. At the same time, Sarah was arguing with Ameya over who should lead the database design and development effort for this project. While Sarah acknowledges that Ameya has a few years more experience than she does in database development, she only agreed to be on this project in order to take a lead role and develop her skills further so she could advance at the company. If she knew Ameya was going to be the lead she wouldn't have bothered joining this project team. Additionally, Mohammed appears to be off and running on his own, not keeping the others apprised of progress nor keeping his information up to date on the SharePoint site. No one really knows what he has been working on or how much progress is being made.
Sandra had initially taken a side role during these exchanges, hoping that the team would work it out for themselves. However, she understands from past experience managing many project teams that it is important for her to take control and guide the team through this difficult time. She convenes all of the team members for a virtual meeting to reiterate their roles and responsibilities (which were agreed to in the kick-off meeting) and to ensure that they understand the goals and objectives of the project. She made some decisions since the team couldn't come to agreement. She determined that Ameya would lead the database development design component of the project, working closely with Sarah so she can develop further experience in this area. She reviewed the schedule that Peter created with the team, making adjustments where necessary to address the concerns of Donna and Sarah. She reminded Mohammed that this is a team effort and he needs to work closely with the others on the team.
During the virtual meeting session, Sandra referred back to the ground rules the team set in their face-to-face meeting and worked with the team to ensure that there was a plan in place for how decisions are made on the team and who has responsibility for making decisions.
Over the next few weeks, Sandra noticed that arguments/disagreements were at a minimum and when they did occur, they were worked out quickly, by the team, without her involvement being necessary. Still, she monitored how things were going and held regular virtual meetings to ensure the team was moving in the right direction. On a monthly basis, Sandra brings the team together for a face-to-face meeting. As the working relationships of the team members started improving, Sandra started seeing significant progress on the project.

All is Going Smoothly (Stage 3: Norming)

The team has now been working together for nearly 3 months. There is definitely a sense of teamwork among the group. There are few arguments and disagreements that can't be resolved among the team. They support each other on the project - problem solving issues, making decisions as a team, sharing information and ensuring that the ground rules put in place for the team are followed.
Additionally, the team members are helping each other to grow and develop their skills. For example, Ameya has worked closely with Sarah to teach her many of the skills he has learned in database design and development and she has been able to take the lead on accomplishing some of the components of their aspect of the project.
Overall, the team members are becoming friends. They enjoy each other's company - both while working on the project and after hours via communicating on email, via instant messaging, on Twitter, or over the telephone.

Significant Progress is Made! (Stage 4: Performing)

The team is now considered a "high performing team." It wasn't easy getting to this stage but they made it! They are working effectively as a group - supporting each other and relying on the group as a whole to make decisions on the project. They can brainstorm effectively to solve problems and are highly motivated to reach the end goal as a group. When there is conflict on the team - such as a disagreement on how to go about accomplishing a task - the group is able to work it out on their own without relying on the team leader to intervene and make decisions for them. The more junior members - Donna and Sarah - have really developed their skills with the support and help of the others. They have taken on leadership roles for some components of the project.
Sandra checks in with the team - praising them for their hard work and their progress. The team celebrates the milestones reached along the way. When necessary, Sandra provides a link from the team to the executives for decisions that need to come from higher up or when additional support is needed.
The project is on time and within budget. Milestones are being met - some are even ahead of schedule. The team is pleased with how well the project is going along, as is Sandra and the executives of the organisation.

Time to Wrap Up (Stage 5: Adjourning)

The project has ended. It was a huge success! The internal customer is pleased and there is definitely an improvement in how the company supports its clients. It has been a great 8 months working together…with some ups and downs of course. Each of the individuals on the project will be moving to other projects within the organisation, but no one is going to be on the same project. They will miss working with each other but have vowed to remain friends and keep in touch on a personal level - hopefully to work together again soon!
The team has gotten together in the New York office to discuss the project, including documenting best practices and discussing what worked effectively and what they would improve upon given the chance to do it again. Sandra has taken the team out to dinner. They are joined by the project sponsor and some other executives who are extremely pleased with the end result.
The End!
This is a simplistic view of a team working through the five stages of team development. I hope it provides some benefit to you.
Remember that at any time this team could revert back to a previous stage. Let's assume that another individual joins the team - the team will revert back to the "forming" stage as they learn how to work with the new team member; reestablishing team guidelines, finding their way again, and learning how to work cohesively as a team. Or, let's assume that Mohammed slips back into his old ways of keeping to himself and not sharing information with the team - this may cause the team to revert back to the "storming" stage.

Summary

It is important to remember that every team - regardless of what the team is working on - will follow these stages of team development. It is the job of the team leader to help see the team through these stages; to bring them to the point where they are working as effectively as possible toward a common goal.

Thursday 11 February 2016

Access Sharing Drive in Sql server

xp_cmdshell 'net use G: \\ServerName\g PassWord /UserName /persistent:yes'

G:---For Maping Drive Name

g--For Sharing  Drive Name

Thursday 4 February 2016

AngularJS Introduction

AngularJS is a JavaScript framework. It can be added to an HTML page with a <script> tag.

AngularJS extends HTML attributes with Directives, and binds data to HTML with Expressions

AngularJS is a JavaScript Framework

AngularJS is a JavaScript framework. It is a library written in JavaScript.

AngularJS is distributed as a JavaScript file, and can be added to a web page with a script tag:

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
 
 

AngularJS Extends HTML

AngularJS extends HTML with ng-directives.

The ng-app directive defines an AngularJS application.

The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.

The ng-bind directive binds application data to the HTML view.

AngularJS Example

<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>

<div ng-app="">
  <p>Name: <input type="text" ng-model="name"></p>
  <p ng-bind="name"></p>
</div>

</body>
</html>
 
Example explained:

AngularJS starts automatically when the web page has loaded.

The ng-app directive tells AngularJS that the <div> element is the "owner" of an AngularJS application.

The ng-model directive binds the value of the input field to the application variable name.

The ng-bind directive binds the innerHTML of the <p> element to the application variable name.

AngularJS Directives

As you have already seen, AngularJS directives are HTML attributes with an ng prefix.

The ng-init directive initialize AngularJS application variables.

AngularJS Example

<div ng-app="" ng-init="firstName='John'">

<p>The name is <span ng-bind="firstName"></span></p>

</div>

Alternatively with valid HTML:

AngularJS Example

<div data-ng-app="" data-ng-init="firstName='John'">

<p>The name is <span data-ng-bind="firstName"></span></p>

</div>

Note You can use data-ng-, instead of ng-, if you want to make your page HTML valid.
You will learn a lot more about directives later in this tutorial.

AngularJS Expressions

AngularJS expressions are written inside double braces: {{ expression }}.

AngularJS will "output" data exactly where the expression is written:

AngularJS Example

<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>

<div ng-app="">
  <p>My first expression: {{ 5 + 5 }}</p>
</div>

</body>
</html>
 
 
AngularJS expressions bind AngularJS data to HTML the same way as the ng-bind directive.

AngularJS Example

<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>

<div ng-app="">
  <p>Name: <input type="text" ng-model="name"></p>
  <p>{{name}}</p>
</div>

</body>
</html>

You will learn more about expressions later in this tutorial.

AngularJS Applications

AngularJS modules define AngularJS applications.

AngularJS controllers control AngularJS applications.

The ng-app directive defines the application, the ng-controller directive defines the controller.

AngularJS Example

<div ng-app="myApp" ng-controller="myCtrl">

First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{firstName + " " + lastName}}

</div>

<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
    $scope.firstName= "John";
    $scope.lastName= "Doe";
});
</script>

AngularJS modules define applications:

AngularJS Module

var app = angular.module('myApp', []); 
 
AngularJS controllers control applications:

AngularJS Controller

app.controller('myCtrl', function($scope) {
    $scope.firstName= "John";
    $scope.lastName= "Doe";
});
 

Wednesday 3 February 2016

Action Result Return Types In ASP.Net MVC

What is ActionResult ?
ActionResult is the abstract class which is used to show the output to the client in different format as per result view  returned by the controller.
The ActionResult are defined into the controller and controller returns to the client (Browser).
The following are the sub type or types of Action Results which are present in MVC which are used as per output requirement of client.

  1. ViewResult 
  2. PartialViewResult  
  3. EmptyResult 
  4. RedirectResult 
  5.  RedirectToRouteResult 
  6. JsonResult  
  7. JavaScriptResult
  8. ContentResult 
  9. FileContentResult
  10. FileStreamResult
  11.  FilePathResult 
Let us learn in brief about each ActionResult are as

ViewResult
 It returns the a specified view to the response stream such as html. Syntax
public class EmpController : Controller
{
    
    public ActionResult Index()
    {
        return View();
    }
}
PartialViewResult 
 It returns the partial view to the response stream,mostly the partial view call from main view.Its same like as user control in Asp.net.
Syntax
public class EmpController : Controller
{
    
    public ActionResult Index()
    {
        return PartialView("_Empdetails");
    }
}
EmptyResult  
This action returns the empty response to the client. Syntax 
public class EmpController : Controller
{
    
    public ActionResult Index()
    {
      return new EmptyResult();
    }
}
  • RedirectResult -It redirects to the specified url same as Response.Redirect in Asp.net.
 Syntax
public class EmpController : Controller
{
    
    public ActionResult Index()
    {
     return Redirect("http://www.compilemode.com");
    }
}
  • RedirectToRouteResult - Performs an HTTP redirection to a URL that is determined by the routing engine, based on given route data.
Syntax
public class EmpController : Controller
{
    public ActionResult Index()
    {
    filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary(new { 
    action = "View", 
    controller = "EmpController",}));
    }
}
JsonResult
This action Serializes a given View Data object into JSON (JavaScript object notation) format. Syntax 
public class EmpController : Controller
{
    public JsonResult EmpDet()  
        {  
     
            return Json("HI", JsonRequestBehavior.AllowGet);  
        }   
   
}
JavaScriptResult 
This action returns a piece of JavaScript code that can be executed on the client side.
Syntax
public class EmpController : Controller
{
public virtual JavaScriptResult EmpDet()
{
    var script = string.Format(@"
    MaxNotificaitonsToShow = {0};
    ItemsPerPage = 5;",
    GlobalSettings.MaxNotificaitonsToShow);
    return JavaScript(script);
}
}
ContentResult 
It writes content to the response stream without requiring a view. Syntax 
public class EmpController : Controller
{
public ContentResult PersonInfo()
{
    return Content("Hi Vithal Wadje");
}
}
FileContentResult 
It returns a file to the client. Syntax 
public class EmpController : Controller
{
public FileResult DailyReport()
{
    string fileName = @"c:\Vithal Wadje\DailyReport.pdf";
    string contentType = "application/pdf";
 
    return new FilePathResult(fileName, contentType);
}
}
FileStreamResult  
This action returns a file to the client, which is provided by a Stream. Syntax
public class EmpController : Controller
{  
public ActionResult DownloadFile()
{
    string Fileinfo =@"c:\Vithal Wadje\DailyReport.txt";
    byte[] data = Encoding.UTF8.GetBytes(Fileinfo );
    return File(data, "text/plain","DailyReport.txt");
}
}
FilePathResult  
This action returns a file to the client.  Syntax 
public class EmpController : Controller
{
public FilePathResult DownloadFile(string file, Guid GuID)
{ 
    return File(FileStream, "application/octet-stream", fileName);
}
} 

JsonResult Type in MVC

What is JsonResult ?
JsonResult is one of the type of MVC action result type which returns the data back to the view or the browser in the form of JSON (JavaScript Object notation format).
Step 1 : Create an MVC application
  1. "Start", then "All Programs" and select "Microsoft Visual Studio 2015".
  2. "File", then "New" and click "Project" then select "ASP.NET Web Application Template", then provide the Project a name as you wish and click on OK.
  3. Choose MVC empty application option and click on OK
Step 2 : Create Model Class
Right click on Model folder in the created MVC application, give the class name employee or as you wish and click OK.
Employee.cs
public class Employee
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string City { get; set; }
        public string  Address { get; set; }
    }
Step 3 : Add controller class
Right click on Controller folder in the created MVC application ,give the class name Home or as you 
and click on OK
HomeControlle.cs
public class HomeController : Controller
    {
        // GET: Home
        public ActionResult Index()
        {
        return View();
        }
        [HttpGet]
        public JsonResult EmpDetails()
        {
        //Creating List
            List<Employee> ObjEmp = new List<Employee>()
            {
        //Adding records to list
        new Employee {Id=1,Name="Vithal Wadje",City="Latur",Address="Kabansangvi" },
        new Employee {Id=2,Name="Sudhir Wadje",City="Mumbai",Address="Kurla" }
            };
        //return list as Json
        return Json(ObjEmp, JsonRequestBehavior.AllowGet);
        }
    }

In the above controller class JsonResult method EmpDetails we have added the records into the Generic list and returning it as JSON to avoid database query for same result.

Possible Error
If you return JSON method without setting JsonRequestBehavior property to AllowGet then the following error will occur.

Why error occurred ?
The GET request by default not allowed in JSON result so to allow GET request in JsonResult we need to set JsonRequestBehavior to AllowGet as in the following code snippet:
Json(ObjEmp, JsonRequestBehavior.AllowGet);    
Now run the application and the Json result output will be shown into the browser as in the following screenshot:

 Now we have successfully returned the JsonResult, let's bind view from this JsonResult as in the following step:

Step 4 : Add Partial view
Right click on Home folder inside the View folder in the created MVC application as


Give the name EmpDetails and click Add button.
To bind view using json we need JQuery and the following JQuery library to communicate to the controller from view:
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
 The preceding JQuery library file version may be different (lower or higher). Now write the following code into the partial view created:
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script>
    $(document).ready(function () {
        //Call EmpDetails jsonResult Method
        $.getJSON("Home/EmpDetails",
        function (json) {
        var tr;
        //Append each row to html table
        for (var i = 0; i < json.length; i++) {
                tr = $('<tr/>');
                tr.append("<td>" + json[i].Id + "</td>");
                tr.append("<td>" + json[i].Name + "</td>");
                tr.append("<td>" + json[i].City + "</td>");
                tr.append("<td>" + json[i].Address + "</td>");
                $('table').append(tr);
            }
        });
    });
</script>
<table class="table table-bordered table-condensed table-hover table-striped">
        <thead>
        <tr>
        <th>Id</th>
        <th>Name</th>
        <th>City</th>
        <th>Address</th>
        </tr>
        </thead>
        <tbody></tbody>
</table>

Step 5 : Call partial view EmpDetails in Main Index view
Now call the partial view EmpDetails in Main Index view as using following code
@{
    ViewBag.Title = "www.compilemode.com";
}
<div style="margin-top:20px">
@Html.Partial("EmpDetails");
</div>
Step 6 : Run the application

compilemode.com

From the preceding examples we have learned about JsonResult type using the scenario on how to bind view using JSON data in ASP.NET MVC.

EmptyResult Return Type In ASP.NET MVC

What is EmptyResult ?
The EmptyResult is a class in MVC which does not return anything at client site ,its just like Void method .
 EmptyResult is used when you wants to execute logic return inside the controller action method but does not want any result back to the view then EmptyResult return type is very important .
Key points

  • It does not return any output to the browser .
  • It shows the empty result set to the browser without any adding the view .
  • Does not require to add the view 
Methods of  EmptyResult The following are the methods of  EmptyResult class
  • Equals  : This method is used to check whether the two objects are equal or not. 
  • ExecuteResult : This method is used to execute the specific result context.
  • Finalize  : This method is used to free the memory which is occupied by object and allow to allocate another object in freed memory .
  • GetHashCode: It is used to get the numeric value which is used to identify and insert an object in hash based collection. 
  • GetType  : This method is used to check the what is the type of object .
  • MemberwiseClone: This method is used to create the shallow copy of the current object .
  • ToString : This method is used to convert the current result to the string .
I hope you have understand about the EmptyResult  type from preceding brief summary ,now let's implement its practically.
Step 1 : Create an MVC application
  1. "Start", then "All Programs" and select "Microsoft Visual Studio 2015".
  2. "File", then "New" and click "Project" then select "ASP.NET Web Application Template", then provide the Project a name as you wish and click on OK.
  3. Choose MVC empty application option and click on OK
Step 3 : Add controller class
Right click on Controller folder in the created MVC application ,give the class name Home or as you 
and click on OK
HomeControlle.cs
public class HomeController : Controller
    {
        // GET: for main view
        public EmptyResult EmptyData()
        {
        return new EmptyResult();
        }
        
    }
In the above controller class we have added to action method that is EmptyData which returns EmptyResult means nothing .
Lets run the application and see the output.













From above examples we have learned about the  EmptyResult return type and its use.

PartialViewResult Return Type In MVC

MVC controller returns many types of output to the view according to the data we need for the application. In this article we will learn about PartialView  result type of MVC . So instead of going into the depth on the subject, let us start with its practical implementation.
To know more about the Action result types please refer my previous article 
 What is ActionResult ?
It is the type of output format which is shown to the client .
What is PartialViewResult?
PartialViewResult is used to return the partial view , basically it is a class which implements the ViewResultBase abstract class that used to render partial view.
PartialViewResult class inherit from ViewResultBase class So it implements the properties and methods of ViewResultBase class which are used to work and render partial views.  The following are the properties of PartialViewResult which are inherited from ViewResultBase.
Key points
  • It does not uses layout page since it render in to the main view which has already layout page.
  • It used to return the portion of web page instead of whole page.
  • It does not fire all page events like main view.
  • Its called into the main view  to show list of records and other data to the user.
Properties of  PartialViewResult (ViewResultBase)
  •  Model
  • TempData
  • View
  • ViewBag
  • ViewData
  • ViewEngineCollection
  • ViewName
Methods of  PartialViewResult (ViewResultBase)
  • ExecuteResult
  • FindView
  • Equals()
  • Finalize()
  • GetHashCode()
  • GetType()
  • MemberwiseClone()
  • ToString() 
I hope you have understand about the PartialViewResult type from preceding brief summary ,now let's implement its practically.
Step 1 : Create an MVC application
  1. "Start", then "All Programs" and select "Microsoft Visual Studio 2015".
  2. "File", then "New" and click "Project" then select "ASP.NET Web Application Template", then provide the Project a name as you wish and click on OK.
  3. Choose MVC empty application option and click on OK
Step 3 : Add controller class
Right click on Controller folder in the created MVC application ,give the class name Home or as you 
and click on OK
HomeControlle.cs
public class HomeController : Controller
    {
        // GET: for main view
        public ActionResult Index()
        {
        return View();
        }
        [HttpGet]
        public PartialViewResult EmpList()
        {
        //for partial view

        return PartialView();
        }
    }
In the above controller class we have added to action method that is Index which returns the main view and EmpList which returns the partial view .
Step 2 : Add main view
Right click on Home folder inside the View folder in the created MVC application as

Give the name Index and click Add button.
Step 3 : Add partial view
Right click on Home folder inside the View folder in the created MVC application as
Step 4 : Run the application and call partial view by typing Home/EmpList with base address .it renders the page as

In the preceding example of partialview result ,you might be noticed that it has no layout page
Step 5 : Call Partial view in Main view
Write the following code into main view index to render the partial view
<div>

   @Html.Partial("EmpList")
</div>
Now run the application the output will be look like as follows

SqlDataBaseLibrary

using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using AOS.Repository.Infrastructure; using S...