If you’ve got a similar error as on following image:

that your script resources related with components like UpdatePanel or ScriptManager are not working correctly, think about routing. It may by caused by many other reasons as wrote on similar blog post across the web e.g. wrong version of related System.Web.Extensions.dll or wrong IIS configuration or incorrect handlers defined in web.config. BUT when you are working in hybrid ASP.NET application where are .aspx + .chtml pages together (old Web Forms and new MVC) the problem will probably be routing.
Check and correct your RouteConfig.cs as on following image:

public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
// Default MVC routing
routes.MapRoute(
name: "D1",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Default", action = "Index", id = UrlParameter.Optional }
);
}
Enjoy!
Be careful when you are using your own constructor in partial classes on entities generated for LINQ to SQL (Data context entities). When you create your own constructor is really important to call the default constructor in it. Example :

Why? Because is important to execute the default generated constructor while execution of your program. This constructor contains some Initialization under your entity:

Otherwise you will getting following error:
[NullReferenceException: Object reference not set to an instance of an object.]
System.Data.Linq.Mapping.EntitySetDefSourceAccessor`2.GetValue(T instance) +18
System.Data.Linq.Mapping.MetaAccessor`2.GetBoxedValue(Object instance) +56
System.Data.Linq.StandardTrackedObject.HasDeferredLoader(MetaDataMember deferredMember) +128
System.Data.Linq.StandardTrackedObject.get_HasDeferredLoaders() +130
System.Data.Linq.StandardChangeTracker.Track(MetaType mt, Object obj, Dictionary`2 visited, Boolean recurse, Int32 level) +269
System.Data.Linq.StandardChangeTracker.Track(Object obj, Boolean recurse) +113
System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity) +383
When we are writing every application (software), we are localizing the resources. Every text information writing to the .resx files as follows :
Commonly we are using 2 languages (English as default and Slovak as optional, because Slovak is our motherly language). So in this case we need 2 resource files for as follows:

And what was the issue? The issue is effectiveness of translating from one language to another. This issue is in visual studio little bit complicated, because you need to synchronize every keys from one file to another. And for this purpose we are using cool tool called Zeta resource editor. Look at the following picture:

Zeta resource editor provide you edit values for particular key very confortable on one screen (on one line). And the best feature is the finding of missing keys. You can easily add new value for particular missing key.

Is really useful in situations, when your resource files are not sync. and some keys missing in both files.
While developing our brand new LiveChat called ”Suppo.biz”, I noticed interesting behaviour, what I never noticed before. In the functions like @Html.EditorFor, @Html.TextBoxFor … or @Html.TextArea, @Html.TextBox … When you do AJAX “postback” of your form like this:
@using (Ajax.BeginForm(new AjaxOptions { HttpMethod = "Post", InsertionMode = InsertionMode.Replace, UpdateTargetId = "FormAjaxContainer" }))
{
@Html.AntiForgeryToken()
<div id="FormAjaxContainer">
<div class="form-group">
@Html.LabelFor(model => model.WidgetThemeColor, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.ValidationMessageFor(model => model.WidgetThemeColor, "", new { @class = "text-danger" })
<div class="input-group BGColorPicker">
<span class="input-group-addon"><i></i></span>
@Html.EditorFor(model => model.WidgetThemeColor, new { htmlAttributes = new { @class = "form-control" } })
</div>
</div>
</div>
</div>
}
with value “A” on property WidgetThemeColor and on the server you change the value to value “B” you still see on the input field the value “A”. Its caused by interesting behaviour of the helper function of all controls like @Html.EditorFor, @Html.TextBox …
They first use the value of the POST request and after that the value in the model. This means that even if you modify the value of the model in your controller action if there is the same variable in the POST request your modification will be ignored and the POSTed value will be used. When you want to apply your new value from controller, you need to do this:
Or for particular property by this statement :
ModelState.Remove("WidgetThemeColor");
And the POSTed value will be ignored while rendering of the View or PartialView.
Názov tohto príspevku som prepisoval snáď 10 krát. Pravdepodobne nie je podľa neho jasné o čo pôjde, tak to skúsim objasniť: Ak chcete validovať formulárové prvky v ASP.NET MVC a na ich design používate Bootstrap, a súčasne na validáciu na klientskej strane používate javascriptovú knižnicu jQuery.Validate tak sa určite dostanete do rovnakej situácie ako ja. jQuery Validate pridáva css triedy s názvom “input-validation-error” a “valid” priamo do input elementu (alebo iných elementov formulára) čo je síce pekné, ale nechce sa mi dizajnovať niečo, čo už bootstrap vyriešil za mňa. Ak chceme použiť korektne knižnicu bootstrap, tak tá to potrebuje mať povedané v inom formáte. (Formát validného/nevalidného prvku nájdete na bootstrap stránke v sekcii Validation states). Čo s tým? ideálne toto:
jQuery.validator.setDefaults({
highlight: function (element, errorClass, validClass) {
if (element.type === 'radio') {
this.findByName(element.name).addClass(errorClass).removeClass(validClass);
} else {
$(element).addClass(errorClass).removeClass(validClass);
$(element).closest('.form-group').removeClass('has-success').addClass('has-error');
}
},
unhighlight: function (element, errorClass, validClass) {
if (element.type === 'radio') {
this.findByName(element.name).removeClass(errorClass).addClass(validClass);
} else {
$(element).removeClass(errorClass).addClass(validClass);
$(element).closest('.form-group').removeClass('has-error').addClass('has-success');
}
}
});
Upraviť metódy highligh a unhighligh uvedeným spôsobom. (aby pridávali triedy has-success a has-error do nadradeného DIV elementu s triedou form-group).