views:

333

answers:

3

I get the following error message when rendering a partial view with a jGrid on.

"Microsoft JScript runtime error: '$.jgrid.defaults' is null or not an object"

I have included the relevant .js files. I am concerned about the following line in jquery.jqGrid.js

var pathtojsfiles = "/Scripts/";

All my .js files are under the scripts folder of my project.

A: 

Try

<%= this.ResolveClientUrl("~/Scripts/js/jquery.jqGrid.js") %>
solkim
A: 

Try

<%= Url.Content("~/Scripts/js/jquery.jqGrid.js") %>
Kimoz
A: 

I'm 1 week into ASP.NET MVC and I'm getting the same error in the jqMVCGrid project when I click on an "Edit" or "Detail" link...

Where is the "pathToFiles" set?

And where would I use the two suggestions listed above:

"<%= this.ResolveClientUrl("~/Scripts/js/jquery.jqGrid.js") %>"

"<%= Url.Content("~/Scripts/js/jquery.jqGrid.js") %>"

Thanks!

Peg
Probably should be a different question, since it doesn't answer this question. Better post it separately ("Ask Question" button in the top right of the page). More people will see your question that way and you have better chances for good answers.
sth