Most common problems and solutions
JSON is undefined
on IE8 and lower; seen in browser console;
you need to reference JSON2.js https://github.com/douglascrockford/JSON-js/blob/master/json2.js
A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies....'
Happens when json serializing the GridModelBuilder<Model>.Build result (gridmodel) and the grid Model has a circular reference in the object hierarchy, you solve this problem by setting the Map property, example:
new GridModelBuilder<MyCircularModel>(list, g)
Map = o => new
o.Prop1, // and specify here only the properties that you need to display
Clicking PopupForm Ok button does nothing
if there's no js errors (look in the browser console) and nothing happens it's most likely the client side validation preventing the form submit, but you can't see the validation error because you don't have an Html.ValidationMessage for that field
It (Grid/AjaxDropdown/etc.) doesn't work/load
do F12 -> Console and after click on the "Open Popup" link, you should see an error 500, that's because at the server side we have a throw Exception in the action called).
Also, make sure you have unique html ids/helper names
, for example if you have something like this:
@Html.Awe().Lookup("Foo") @Html.Awe().Lookup("Foo") // you'll have 2 lookups both with html id = "Foo", this will cause problems
or even if you have on the page and another one with same id being loaded via ajax e.g. in a popupform it will also cause problems
you can use the .Prefix extension to add a prefix to the html id or just use a different name
Make sure the Url that returns content to the popup is not returning the masterpage as well (_Layout.cshtml), because this will load all the js scripts again which may cause problems. So, if you are setting:
Layout = "~/Views/Shared/_Layout.cshtml";
in _ViewStart.cshtml, this means that all the views will have the same Layout, and you can either return PartialView() in your action or set Layout = null in the view
Getting trial message after purchasing and using the downloaded binaries
You need to replace all the files
, your browser could cache the
files, most times refresh is enough, clearing the cache could be necessary, or you could modify the script urls by adding a version e.g.
. The dll can sometimes be cached by Visual Studio, so you may need to restart VS, and/or clear all the bin folders.
Isolate the problem
Usually when you ask a question on our forums (or codeplex, stackoverflow) and it's hard for us to understand the problem, we will ask you to create a mini project that will isolate the problem. Often times people find the solution while they are doing this mini project. The project should use the trial version of ASP.net MVC Awesome and should not use any Database, use sample objects instead (you can use the Db class that is used for tutorials), after you zip it, upload it somewhere and post the link so we could have a look at it. We recommend that you make this mini project by downloading and editing the MVCMinSetupDemo