简体   繁体   中英

asp.net MVC jquery grid

I am trying a hello world project with ASP.net MVC and jquery grid

Followed the steps as per http://haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx

Everything seems to be fine when hitting F5 from VS2008. the grid is showing the data from the db

Now, when I set up a virtual directory and pointed to the same project, no data comes up

So I tried modifying the URL property of jquery grid from

    //url: '/Home/GetGridData/',

to url: '<% =Url.Action("GetGridData","~/Home") %>',

Still the data does not show up

Using fiddler, the differences when running in F5 mode and in virtual directory mode, there is the difference in the URL being requested

F5 http://localhost.:1188/Home/GetGridData?nd=1267102892819&_search=false&rows=10&page=1&sidx=Activity&sord=asc

Virtual directory http://mymachine/dashboard/Home/GetGridData?nd=1267102919267&_search=false&rows=10&page=1&sidx=Sno&sord=asc

Now, how do i fix up this error

The second parameter for Url.Action should be controllerName, not a virtual path. Use "Home" instead of "~/Home" .

You need to modify URL ROUTING OR ADD NEW ROUTING. Virtual machine URL is parsing wrongly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM