What are the differences between Html.TextBox and Html.TextBoxFor?

  • Html.TextBox and Html.DropDownList are not Strongly typed and hence they doesn’t require a Strongly typed View. This means we can hard code whatever name we want. On the other hand, Html.TextBoxFor and Html.DropDownListFor are Strongly typed, so require a Strongly typed View and the name is inferred from thelambda expression.

Continue reading

Advertisements

Important ASP.NET MVC Interview Questions

Below mentioned ASP.NET MVC interview questions must be prepared before appearing for a MVC interview.

1. Explain MVC (Model-View-Controller) in general?
MVC (Model-View-Controller) is an architectural software pattern that basically decouples various components of a web application. By using MVC pattern, we can develop applications that are more flexible to changes without affecting the other components of our application. Continue reading

Tips to improve Entity Framework Performance

 

  • Avoid to put all the DB Objects into One Single Entity Model

    Entity Model specifies a single unit of work, not all our database. If we have many database objects that are not connected to one another or these(log tables, objects used by batch processes,etc.) are not used at all. Hence these objects are consuming space in the memory and cause performance degrades. So try to make separate entity models of related database objects.

Continue reading

Var and IEnumerable with LINQ

 IEnumerable is an interface that can move forward only over a collection, it can’t move backward and between the items. Var is used to declare implicitly typed local variable means it tells the compiler to figure out the type of the variable at compilation time. A var variable must be initialized at the time of declaration. Both have its own importance to query data and data manipulation. Continue reading

IEnumerable VS IQueryable

In LINQ to query data from database and collections, we use IEnumerable and IQueryable for data manipulation. IEnumerable is inherited by Iqueryable, hence it has all the features of it and except this, it has its own features. Both have its own importance to query data and data manipulation. Let’s see both the fetures and take the advantage of both the fetures to boost your LINQ Query performance. Continue reading

MVC HTML.Form vs Ajax.Form

  • Postback – HTML.BeginForm renders a Form tag which makes a complete postback to the server on submit. In the other hand Ajax.BeginForm renders a form tag which will make an asynchronous request to server.
  • Rendering -Html.BeginForm leads to complete page refresh whereas Ajax.BeginForm leads to only part of the page update.
  • How page updates –

Continue reading