Thursday, March 12, 2015

Asp .net MVC hidden field can't set value using jquery [Solved]

My hidden field is declared like this:
@Html.HiddenFor(model => model.Token, new { ClientIDMode = "Static" })

Then assign the value bellow way in hidden field
 var token = response.id;                    
 $('#Token').val(token);

Mention: You have to Set ClientIDMode="Static" and then you can use $('#Token').val(token); to set the value in asp.net hidden

Happy programming !

Wednesday, March 4, 2015

Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0 [Solved]

When I am working on mvc application using vs2013 and windows 8.
I got this bellow error messsage :

Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

[Solved]

I fixed this issue bellow way:
Project-->Manage Nuget Package-->Updates --> nuget.org-->Update All