Creating MVC4 Application with Model First Entity Framework

Before going to the details please refer the following URL to create simple web application Using Asp.Net MVC 3. How to Create Website using ASP.Net MVC
In this post we will see how to create simple MVC 4 Application with Model First Entity Framework.

First we see how to create simple application using Asp.Net MVC4

Optimize the JQuery Selectors


Some tips keep in mind when Select element using JQuery Selectors

Selectors Using ElementID

When creating JQuery selector with element Id means, it’s best to start your selector with element ID

Fast:

$("#container div.robotarm");
        This approach is slow because it did not follow Sizzle selector engine, Only ID selections are handle using document.getElementByID()

Super-fast:

$("#container").find("div.robotarm");
        The .find() approach is faster because the selection is handled  using Sizzle selector engine .which is extremely fast because it is native to the browser.

Specificity

                When creating a JQuery selector be more specific on the right-hand side of your selector, and less specific on the left.

Unoptimized:

         $("div.data .gonzalez");

Optimized:

         $(".data td.gonzalez");
         Use <tag>.<class> if possible on your right-most selector, and just tag or just .class on the left.

Avoid the Universal Selector

Selections that specify or imply that a match could be found anywhere can be very slow.
Extremely expensive:
         $(".buttons > *");

Much better:

         $(".buttons").children();

Implied universal selection:

         $(".category :radio");

Same thing, explicit now:

         $(".category *:radio");

Much better:

         $(".category input:radio");

How To Install Asp.Net MVC 4

In this post we will see How to Install Asp.Net MVC 4 In our Machine.In Visual Studio 2010 MVC 2 And MVC 3 are default  integrated but If we want to create MVC 4 application you have to install MVC 4 in you machine.before install MVC 4 you Project Template look like bellow.it means you did not install MVC 4 in your machine.

Using Web Installer


How to Create Website using ASP.Net MVC 3

MVC grid Bulk Update using XML, Convert MVC FormCollection to XML using XmlDocument


In this post we will see how to create MVC3 Application using Visual studio 2010 step by step
  1.  First open Visual studio
  2. Select File -> New -> Project, then select Asp.Net MVC 3 Web Applicatio 
  3. In Name textbox enter TelerikBulkUpdate click ok
  4.    

Login failed for user 'username'. Reason: The account is disabled. (Microsoft SQL Server, Error: 18470)

                 
              I just down load SQL Server 2008 R2 and install it in my system after install it my system I try to Loging As “sa” I got a error Login failed for user "sa" error 18456 I solved that error with help of following post " Login failed for user "sa" error 18456 .After I try to loging using “sa”.After  that I got another error "Login failed for user 'username'. Reason: The account is disabled. (Microsoft SQL Server, Error: 18470)".

String Split Method Overview

String Split
Split() method Returns a string array that contains the substrings that are delimited by elements of a specified string or Unicode character array are given in Split method parameter.
Split string with Char
class Program
{
static void Main(string[] args)
{
string strOrginal = "Welcome to Asp.Net" ;
string[] strArray = strOrginal.Split(' ');
foreach (string str in strArray)
{
Console.WriteLine(str);
}
Console.ReadLine();
}
}
Out Put
Welcome
to
Asp.Net

Split string with Char[] - Split(char[] separator)

C# Anonymous Types

What is Anonymous Types?

        Anonymous types provide a convenient way to encapsulate a set of read-only properties into a single object without having to explicitly define a type first. The type name is generated by the compiler and is not available at the source code level. The type of each property is inferred by the compiler.
The following example shows

C# Object and collection initializers


What is Object Initializer?

          Object initializers provide a way to assign values to any accessible fields or properties of an object at creation time without having to explicitly invoke a constructor.

First create Employee class