Note that there are some explanatory texts on larger screens.

plurals
  1. POUnexpected Results with Paging after deploying application to IIS (MVC3, EF 4.3)
    text
    copied!<p>I am currently deployment on an MVC 3 website which uses Entity Framework 4.3 for database access.</p> <p>The application works as expected in the Visual Studio development server but once it is deployed to the remote server the query reacts unexpectedly </p> <p>It should display a sorted list and pages through that sorted data</p> <p>I've tried restarting the web server and the physical server machine to make sure the cache is gone and even tried using a clean IIS Site on the remote server with the same result. </p> <p>[Edit]: I have also done a full delete and republish to a clean site as well </p> <p><strong>On Development Machine</strong></p> <p><img src="https://i.stack.imgur.com/oM0Xp.jpg" alt="development machine"></p> <p><strong>On the Remote Server</strong></p> <p><img src="https://i.stack.imgur.com/GW0at.png" alt="enter image description here"></p> <p><strong>The code I am using to generate the tables:</strong></p> <p><em>Controller</em></p> <pre><code> [HttpGet] public virtual ActionResult Index(string filter = "", int? page = null) { page = page ?? 1; filter = filter.Trim().ToLower(); int pageSize = Properties.Settings.Default.DefaultSPPageSize; int skipNum = (page.Value - 1) * pageSize; IQueryable&lt;SamplePoint&gt; spList; var points = new HashSet&lt;string&gt;(Settings.Default.SamplePointFilter.Split(',')); if (filter != "") spList = db.SamplePoints.Where(e=&gt; points.Any(p=&gt; e.Id.StartsWith(p)) &amp;&amp; e.Id.ToLower().Trim().StartsWith(filter.ToLower())) .OrderBy(o =&gt; o.Id); else spList = db.SamplePoints.Where(e =&gt; points.Any(p =&gt; e.Id.StartsWith(p)) &amp;&amp; e.Id.Trim().StartsWith(filter)).OrderBy(o =&gt; o.Id); List&lt;SamplePoint&gt; pageItems; if (page != 0) { pageItems = spList.Skip(skipNum).Take(pageSize).ToList(); } else { pageItems = spList.OrderBy(o=&gt; o.Id).ToList(); } int _totPages = Convert.ToInt32(pageSize &gt; 0 ? Math.Ceiling(((double)spList.Count() / (double)pageSize)) : 0); var vModel = new SamplePointListViewModel(pageItems, filter) { LocationList = FilterListItems, TotalPages = _totPages, CurrentPage = page.Value }; return View(this.IsExcelRequest() ? MVC.Reports.Views.Excel.SamplePointList : MVC.Reports.Views.SamplePointList, vModel); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload