MVChttp://forums.asp.net/1146.aspx/1?MVCDiscussions regarding ASP.NET Model-View-Controller (MVC)Wed, 22 May 2013 15:18:58 -0400urn:uuid:00000000-0000-0000-0000-000000001146urn:uuid:00000000-0000-0000-0000-000005402362http://forums.asp.net/p/1908827/5402362.aspx/1?What+Is+Best+Practice+For+AJAX+Data+CallsWhat Is Best Practice For AJAX Data Calls <p>I have some pages on my MVC website that need to retrieve data from the server without refreshing or leaving the page.&nbsp; I currently use code like that shown below to call jQuery .ajax and wait for a value to return from an MVC controller method.&nbsp; It works.&nbsp; Is there a better way to do this?&nbsp; Can I retrieve the data directly from the jQuery calls without going through a response method and loading a value into a hidden tag then reading that hidden value?&nbsp; That seems very awkward.&nbsp; Also, I have seen that it is possible to return an ActionResult instead of a bool by using this.Content(sReturnValue).&nbsp; Is that better than having the controller method return a bool?</p> <pre class="prettyprint">// client-side javascript code: function GetDateExists(sStoreID, sTestDate) { var bDateExists = false; var oDateExistsResponseSpan = document.getElementById(&quot;DateExistsResponseSpan&quot;); oDateExistsResponseSpan.innerText = &quot;No Response Received&quot;; var oResponse = $.ajax({ url: &quot;/Sponge/Financial/DateExists&quot;, type: &quot;POST&quot;, data: { StoreID: sStoreID, TestDate: sTestDate }, async: false }); oResponse.done(DateExistsResponse); var sDateExists = oDateExistsResponseSpan.innerHTML; if (sDateExists.toLowerCase() == &quot;true&quot;) { bDateExists = true; } return bDateExists; } function DateExistsResponse(sResponse) { var oDateExistsResponseSpan = document.getElementById(&quot;DateExistsResponseSpan&quot;); oDateExistsResponseSpan.innerHTML = sResponse; } // server-side C# code in Financial controller: public bool DateExists(int StoreID, DateTime TestDate) { TestModel oTestModel = new TestModel(StoreID, TestDate); bool bDateExists = oTestModel.GetDateExists(TestDate); return bDateExists; }</pre> <p></p> 2013-05-22T15:08:46-04:002013-05-22T15:08:46.45-04:00urn:uuid:00000000-0000-0000-0000-000005397426http://forums.asp.net/p/1906866/5397426.aspx/1?PagedListPagedList <p>I am currently working on a demo site that uses the Adventure works sample data base. It is just for my own amusement and to show potential employers, if need be. I am using pagedlist but cannot get the AjaxOptions() feature to work. I thought I could get it to work just like my AjaxBeginForm(), but it always does a full page refresh. I downloaded the source from TroyGoode pagedlist. But I am very much the novice and I cannot figure out how to go about making mine work by looking at his code. Specifics would be appreciated. Thanks in advance!!</p> <p>Here is the code I have:</p> <p>The controller method:</p> <p>public ActionResult All(int? page, string searchString = null)<br> {<br> ViewBag.PageTitle = &quot;Products&quot;;<br> if (Request.IsAjaxRequest())<br> {<br> var products = repository.GetProducts;</p> <p>if (!String.IsNullOrEmpty(searchString))<br> products = products.Where(x =&gt; x.Name.ToUpper().StartsWith(searchString.ToUpper()));<br> else<br> return null;</p> <p>return PartialView(&quot;_ProductSummaryPartial&quot;, products);<br> }<br> else<br> { <br> ViewBag.CurrentFilter = searchString;</p> <p>var products = repository.GetProducts;</p> <p>if (!String.IsNullOrEmpty(searchString))<br> products = products.Where(x =&gt; x.Name.ToUpper().Contains(searchString.ToUpper()));</p> <p>int pageSize = 10;<br> int pageNumber = page ?? 1;</p> <p>return View((products.OrderBy(x =&gt; x.Name).ToPagedList(pageNumber, pageSize)));<br> }<br> }</p> <p>The view:</p> <p>@model IPagedList&lt;AWBikeShop.Domain.Entities.Product&gt;<br> @using PagedList;<br> @using PagedList.Mvc;<br> @{<br> ViewBag.Title = &quot;AW Bikes - Products&quot;;<br> }<br> &lt;div id=&quot;pitch&quot;&gt;<br> &lt;br /&gt;<br> &lt;br /&gt;<br> @using (Ajax.BeginForm(&quot;All&quot;, &quot;Products&quot;, new AjaxOptions()<br> {<br> HttpMethod = &quot;GET&quot;,<br> InsertionMode = InsertionMode.Replace,<br> UpdateTargetId = &quot;products&quot;<br> }, new { id = &quot;searchForm&quot; }))<br> {<br> &lt;h1&gt;@ViewBag.PageTitle&lt;/h1&gt;<br> &lt;div class=&quot;ui-widget&quot;&gt;<br> @Html.TextBox(&quot;searchString&quot;, ViewBag.CurrentFilter as string)<br> &amp;nbsp;&lt;input class=&quot;submit&quot; type=&quot;submit&quot; value=&quot;Search&quot; /&gt;<br> &lt;/div&gt;<br> }<br> &lt;/div&gt;<br> &lt;div id=&quot;products&quot;&gt;<br> @{ Html.RenderPartial(&quot;_ProductSummaryPartial&quot;, Model); }</p> <p>&lt;br /&gt;<br> &lt;hr /&gt;<br> &lt;br /&gt;</p> <p>&lt;div class=&quot;pager&quot; data-target=&quot;#products&quot;&gt;<br> @Html.PagedListPager((IPagedList)Model, page =&gt; Url.Action(null, new { page }),<br> PagedListRenderOptions<br> .EnableUnobtrusiveAjaxReplacing(new AjaxOptions()<br> {<br> UpdateTargetId = &quot;products&quot;,<br> InsertionMode = InsertionMode.Replace,<br> HttpMethod = &quot;GET&quot;<br> })));<br> &lt;/div&gt;</p> <p>The partial view:</p> <p>@model IEnumerable&lt;AWBikeShop.Domain.Entities.Product&gt;</p> <p>@Scripts.Render(&quot;~/bundles/aw&quot;)<br> &lt;table&gt;<br> &lt;tr&gt;<br> &lt;th&gt;<br> @Html.DisplayName(&quot;Name&quot;)<br> &lt;/th&gt;<br> &lt;th&gt;<br> @Html.DisplayName(&quot;Price&quot;)<br> &lt;/th&gt;</p> <p>&lt;th&gt;<br> @Html.DisplayName(&quot;Image&quot;)<br> &lt;/th&gt;<br> &lt;th&gt;&lt;/th&gt;<br> &lt;/tr&gt;</p> <p>@foreach (var p in Model)<br> {<br> &lt;tr&gt;</p> <p>&lt;td&gt;<br> @Html.DisplayFor(modelItem =&gt; p.Name)<br> &lt;/td&gt;<br> &lt;td&gt;<br> @Html.DisplayFor(modelItem =&gt; p.ListPrice)<br> &lt;/td&gt;</p> <p>&lt;td&gt;<br> &lt;img src=&quot;@Url.Action(&quot;GetThumbImage&quot;, &quot;Image&quot;, new { id = p.ProductProductPhotoes.FirstOrDefault().ProductPhotoID })&quot; alt=&quot;Product Image&quot; /&gt;<br> &lt;/td&gt;<br> &lt;td&gt;<br> &lt;a href=&quot;javascript:openProductDetailsDialog(@p.ProductID);&quot; class=&quot;pager&quot;&gt;Details&lt;/a&gt;</p> <p>&lt;a href=&quot;#&quot; class=&quot;pager&quot;&gt;Add to cart&lt;/a&gt;<br> &lt;/td&gt;<br> &lt;/tr&gt;<br> }<br> &lt;/table&gt;<br> @{Html.RenderPartial(&quot;_ProductDetailsDialog&quot;);}</p> <p></p> <p></p> 2013-05-18T00:14:35-04:002013-05-18T00:14:35.44-04:00urn:uuid:00000000-0000-0000-0000-000005402151http://forums.asp.net/p/1908786/5402151.aspx/1?Could+not+load+file+or+assembly+System+Web+WebPages+RazorCould not load file or assembly 'System.Web.WebPages.Razor <p>When I deploy my MVC website to a hosting provider i keep getting this error:</p> <h2><i>Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.</i></h2> <p>The site works perfectly on my local machine, and I have set the following assemblies to copy local = true</p> <ul> <li>&nbsp;System.Web.Webpages.Deployment </li><li>System.Web.Webpages </li><li>System.Web.Razor </li><li>System.Web.Mvc </li><li>System.Web.Abstractions </li></ul> <p>Could somebody help me? Here's a copy of the stack trace:</p> <table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td> <pre>[FileNotFoundException: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.] Microsoft.Web.Helpers.PreApplicationStartCode.Start() &#43;0 [InvalidOperationException: The pre-application start initialization method Start on type Microsoft.Web.Helpers.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..] System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) &#43;12880923 System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) &#43;12880632 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) &#43;240 System.Web.Compilation.BuildManager.ExecutePreAppStart() &#43;152 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) &#43;1151 [HttpException (0x80004005): The pre-application start initialization method Start on type Microsoft.Web.Helpers.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) &#43;12880068 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) &#43;159 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) &#43;12721257 </pre> </td> </tr> </tbody> </table> 2013-05-22T11:47:14-04:002013-05-22T11:47:14.017-04:00urn:uuid:00000000-0000-0000-0000-000005402575http://forums.asp.net/p/1908880/5402575.aspx/1?HOWTO+Get+session+variable+data+from+another+session+given+its+Session+SessiodId+HOWTO Get session variable data from another session, given its Session.SessiodId. <p>Please help,</p> <p>I have multiple sessions running in a MVC-Web-App. I want one session, to be able to get the session variable data from another running session, given the other sessions's &quot;Session.SessionId&quot;. I need to do this, solely, on the server. No client side interaction at all.</p> <p>Example:</p> <p>Session 1</p> <p>Session[&quot;MyData'] = &quot;Data...&quot;; // Session.SessId =&gt; &quot;mz1f4sr1mrtgieb2us4jeoex&quot;</p> <p>&nbsp;</p> <p>Session 2</p> <p>// This Session.SessionId = &quot;abcf4sr1mrtgieb2us4jeefg&quot;...</p> <p>string csData = Something.GetSessionVariable(&quot;mz1f4sr1mrtgieb2us4jeoex&quot;, &quot;MyData&quot;);</p> <p>// csData ==&gt; Will be set to &quot;Data...&quot;.</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> 2013-05-22T18:28:22-04:002013-05-22T18:28:22.45-04:00urn:uuid:00000000-0000-0000-0000-000005402477http://forums.asp.net/p/1908854/5402477.aspx/1?Beginner+s+question+Beginner's question - <p>I'm looking at the tutorial page:&nbsp;<a href="http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-controller">http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-controller</a></p> <p>Just for giggles I thought I would try overloading the Welcome function.</p> <p>I added a second Welcome with a single integer as it's parameter.&nbsp;</p> <p>This did not work, although it seemed intuitive. &nbsp;Why?</p> <p></p> 2013-05-22T16:42:50-04:002013-05-22T16:42:50.537-04:00urn:uuid:00000000-0000-0000-0000-000005402328http://forums.asp.net/p/1908820/5402328.aspx/1?Editable+ajax+table+in+MVC+4Editable ajax table in MVC 4 <p>Hi all,</p> <p>I'm looking for a demo, hopefully also a tutorial, on how to create an editable table in MVC 4.</p> <p>The table should have 2 modes: data vieweing with no editting, and editting.</p> <p>The table's columns are string, int and drop menus, and entering a differen value of choosing a different item in the drop menu should update a db table.&nbsp; I also need a possibility to insert new rows and delete current ones.</p> <p>I was thinking that pehaps I should use th Ajax.BeginForm to create the forms, but if there's a better way I'll be happy to hear,</p> <p>Thanks,</p> <p>Elior</p> 2013-05-22T14:30:56-04:002013-05-22T14:30:56.557-04:00urn:uuid:00000000-0000-0000-0000-000005402559http://forums.asp.net/p/1908871/5402559.aspx/1?MVC4+SimpleMembershipProvider+Which+Model+holds+the+Role+Actions+MVC4 SimpleMembershipProvider: Which Model holds the Role Actions? <p>Hi&nbsp;</p> <p>I am writing an admin page to add Roles.</p> <p>My controller:</p> <pre class="prettyprint">public ActionResult Create(string role) { Roles.CreateRole(role); return RedirectToAction(&quot;Index&quot;); }</pre> <p>I would like to create a strongly typed view but which Model Class should I use?</p> <p>Which Model class holds the action methods for Roles?<br> <br> </p> 2013-05-22T18:09:09-04:002013-05-22T18:09:09.417-04:00urn:uuid:00000000-0000-0000-0000-000005402050http://forums.asp.net/p/1908755/5402050.aspx/1?How+to+add+java+script+Confirm+into+this+Action+How to add java script Confirm?? into this Action? <p>@Html.ActionLink(&quot;Delete&quot;, &quot;DeleteLetter&quot;, new { id=item.Id})</p> 2013-05-22T10:27:12-04:002013-05-22T10:27:12.657-04:00urn:uuid:00000000-0000-0000-0000-000005401694http://forums.asp.net/p/1908670/5401694.aspx/1?Running+single+MVC+application+for+multiple+database+based+on+URLRunning single MVC application for multiple database based on URL <p>Hello All,</p> <p>I am working with MVC application which is kind of product. So there are multiple clients and all clients have similar database. I can host application at individual virtual directory. This is fine but having problem while I have to made changes into application and wanted to deploy for all client.</p> <p>I am thinking I can have multiple databaes connection string in config file. With the help of &quot;BaseController&quot; or any other built in way of MVC, I can issue new instance of &quot;Entity Framework&quot; and use that instance in page life cycle. Based on host of application, i.e. <a href="http://www.test1.com">http://www.test1.com</a>&nbsp;and <a href="http://www.test2.com"> http://www.test2.com</a>&nbsp;I am planning to change connection string.</p> <p>Is there any alternate built in way to do the same ?</p> <p>Regards,</p> <p>Dharmesh Solanki</p> 2013-05-22T05:40:20-04:002013-05-22T05:40:20.207-04:00urn:uuid:00000000-0000-0000-0000-000005402382http://forums.asp.net/p/1908833/5402382.aspx/1?Use+resource+from+the+core+projectUse resource from the core project <p>Hi,</p> <p>In &nbsp;multi-projects solution, how to access resx under the core project from a subproject, I referenced the Core.dll &nbsp;but I'm unable to access the required resx.</p> <p>Note: the subproject is referenced in the Core project as project</p> <p>may you please help with this.</p> <p></p> <p>Regards,</p> 2013-05-22T15:23:24-04:002013-05-22T15:23:24.823-04:00urn:uuid:00000000-0000-0000-0000-000005402357http://forums.asp.net/p/1908825/5402357.aspx/1?MVC+Application+devolopmentMVC Application devolopment <p>Hi</p> <p>I am new to MVC.</p> <p>Our project can be browsed in Mobile and in PC's so to achieve only way is to have different views. is my assumption correct else any give some links or suggestion to go in different direction.</p> <p></p> <p>REgards</p> <p>Rajesh Kumar.C</p> 2013-05-22T14:59:16-04:002013-05-22T14:59:16.987-04:00urn:uuid:00000000-0000-0000-0000-000005401495http://forums.asp.net/p/1908614/5401495.aspx/1?Why+is+my+page+not+displaying+Why is my page not displaying? <p>I have these menu items, which should all open a View that is used to supply criteria for reports:</p> <pre class="prettyprint">&lt;div id=&quot;divMenu&quot;&gt; &lt;ul&gt; @if ((bool)ViewBag.TLDAuth) { &lt;li&gt;&lt;a href=&quot;/@System.Configuration.ConfigurationManager.AppSettings[&quot;ThisApp&quot;]/TLDCriteria/ReceiptCriteria&quot; title=&quot;@HomeDisplay.DisplayStrings.ReceiptReport&quot;&gt; @HomeDisplay.DisplayStrings.ReceiptReport&lt;/a&gt; &lt;/li&gt; } // This one added 5/21/2013 - test simple rpt @if ((bool)ViewBag.TLDAuth) { &lt;li&gt;&lt;a href=&quot;/@System.Configuration.ConfigurationManager.AppSettings[&quot;ThisApp&quot;]/TLDCriteria/ReceiptRptView&quot; title=&quot;Basic Receipt Report&quot;&gt;Basic Receipt Report&lt;/a&gt; &lt;/li&gt; } @if ((bool)ViewBag.TLDAuth) { &lt;li&gt;&lt;a href=&quot;/@System.Configuration.ConfigurationManager.AppSettings[&quot;ThisApp&quot;]/TLDCriteria/TLISReport&quot; title=&quot;@HomeDisplay.DisplayStrings.TLISReport&quot;&gt; @HomeDisplay.DisplayStrings.TLISReport&lt;/a&gt; &lt;/li&gt; } @if ((bool)ViewBag.OLAPViewerAuth) { &lt;li&gt;&lt;a href=&quot;/@System.Configuration.ConfigurationManager.AppSettings[&quot;ThisApp&quot;]/TLDCriteria/OlapViewer&quot; title=&quot;@HomeDisplay.DisplayStrings.OlapViewer&quot;&gt; @HomeDisplay.DisplayStrings.OlapViewer&lt;/a&gt; &lt;/li&gt; } &lt;/ul&gt; &lt;/div&gt;</pre> <p>They all work except the second one -- the one with the comment "This one added 5/21/2013 - test simple rpt"</p> <p>All of these files exist in the TLDCriteria folder (ReceiptCriteria.cshtml, ReceiptRptView.cshtml, TLISReport.cshtml, and OlapViewer.cshtml), but apparently ReceiptRptView.cshtml is "invisible" somehow, because when I select the menu item for it, I get the YSOD:</p> <p>{[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} <br /><em>Server Error in '/TLDReporter' Application.</em></p> <p><em>The resource cannot be found.</em></p> <p><em>Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.</em></p> <p><em>Requested URL: /TLDReporter/TLDCriteria/ReceiptRptView</em></p> <p><em>Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272</em><br />{[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]} {[]}</p> <p>Besides adding the file in question (ReceiptRptView.cshtml) and a related model (ReceiptRptModel.cs) and controller (ReceiptRptController.cs), I also added this line to Web.sitemap:</p> <pre class="prettyprint">&lt;siteMapNode title="Basic Receipt Report" url="~/TLDCriteria/ReceiptRptView" description="Enter basic criteria and view the basic receipts report" /&gt;</pre> <p>...which mirrors the similar entries that were in it (here they all are, for context):</p> <pre class="prettyprint">&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;siteMap&gt; &lt;siteMapNode title="Applications" url="/CommonLogin/Home/Index" description="duckbilledPlatypiRUs Applications Main Menu"&gt; &lt;siteMapNode title="Main Menu" url="~/Home/Index" description="Transaction Analysis Web Application"&gt; &lt;siteMapNode title="Transaction Analysis" description="Transaction Analysis"&gt; &lt;siteMapNode title="Receipt Report" url="~/TLDCriteria/ReceiptCriteria" description="Enter criteria and view the receipts report" /&gt; &lt;siteMapNode title="Basic Receipt Report" url="~/TLDCriteria/ReceiptRptView" description="Enter basic criteria and view the basic receipts report" /&gt; &lt;siteMapNode title="Transaction Line Item Sales Report" url="~/TLDCriteria/TLISReport" description="Enter criteria and view the line item report" /&gt; &lt;siteMapNode title="Cube Browser" url="~/TLDCriteria/OlapViewer" description="Browse OLAP cube of enterprise data" /&gt; &lt;/siteMapNode&gt; &lt;/siteMapNode&gt; &lt;/siteMapNode&gt; &lt;/siteMap&gt;</pre> <p>So why is ReceiptRptView.cshtml not found and displayed?</p> 2013-05-22T00:07:43-04:002013-05-22T00:07:43.81-04:00urn:uuid:00000000-0000-0000-0000-000005402541http://forums.asp.net/p/1908866/5402541.aspx/1?Call+Action+in+Controller+from+Jquery+Dialog+buttonCall Action in Controller from Jquery Dialog button <p>Hi,</p> <p>I want to create a dialog box that contains information from a java variable (that I received via JSON) and an OK-Button. When I click on the OK-Button I want to call an action in the controller with a parameter I received previously. Would this be the correct way to do it?</p> <p>&nbsp;</p> <p>&lt;div id=”dialog” title=”Warning”&gt;</p> <p>Info from variable</p> <p>&lt;/div&gt;</p> <p>&nbsp;</p> <pre>&lt;script type=&quot;text/javascript&quot;&gt;</pre> <pre>Var x = 5</pre> <p>&#36;(“dialog”).dialog({</p> <p>Buttons: {</p> <p>“Confirm”: function(){</p> <p>location.href='<strong>@Url.Action(&quot;Index&quot;, &quot;Home&quot;, new { name = &nbsp;</strong>&#36;<strong>x})'</strong></p> <p>&#36;(this).dialog('close');</p> <p>}</p> <p>}</p> <p>});</p> <pre>&lt;/script&gt;</pre> <p>&nbsp;</p> <p>&nbsp;thanks,</p> <p>d.rk</p> <p></p> 2013-05-22T17:45:06-04:002013-05-22T17:45:06.317-04:00urn:uuid:00000000-0000-0000-0000-000005402488http://forums.asp.net/p/1908858/5402488.aspx/1?ASP+NET+MVC+app+and+squid+proxy+issuesASP.NET MVC app and squid proxy issues <p>Hi,</p> <p>We have deployed an ASP.NET MVC 3.0 app on IIS 7.5 to our customer facilities. Our customer have some partners who access the application through a squid 2.6 proxy. These partners intermitently&nbsp; experience zero sized reply errors (<a href="http://wiki.squid-cache.org/SquidFaq/TroubleShooting#Why_do_I_sometimes_get_.22Zero_Sized_Reply.22.3F">http://wiki.squid-cache.org/SquidFaq/TroubleShooting#Why_do_I_sometimes_get_.22Zero_Sized_Reply.22.3F</a>).</p> <p>Our customer and his partners are angry because they think it's our fault. The partners say our application is slow. But when we access the application from our office the application is fast. When we access the application through a 3G connection is also fast. And we don't experience zero sized reply errors.</p> <p>What can we do to make our application more squid proxy friendly?</p> <p>What can we do to convince our customer and his partners to fix squid issues?</p> <p>We don't have experience on squid nor linux systems.</p> <p>I've found that disabling &quot;Keep-Alive&quot; on IIS 7.5 may help? What do you think?</p> <p>Sorry for the more or less off topic question. But please help me if you have some experience on this.</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> 2013-05-22T16:59:06-04:002013-05-22T16:59:06.223-04:00urn:uuid:00000000-0000-0000-0000-000005402475http://forums.asp.net/p/1908853/5402475.aspx/1?What+purpose+does+the+name+of+a+Route+serve+is+it+simply+organization+What purpose does the name of a "Route" serve, is it simply organization? <p>I've just read this MVC related tutorial:<br> <a href="http://www.asp.net/mvc/tutorials/controllers-and-routing/creating-custom-routes-cs">http://www.asp.net/mvc/tutorials/controllers-and-routing/creating-custom-routes-cs</a></p> <p><a href="http://www.asp.net/mvc/tutorials/controllers-and-routing/creating-custom-routes-cs"></a>&nbsp;and it shows how to add a custom route to the RouteCollection object. But why create a new route at all?</p> <p>In the tutorial it shows two different routes in global.asax for the tutorial.</p> <p></p> <p>Does the &quot;Default&quot; route have special significance...in other words...is it the only route in which the controller name is not required to be part of the incoming URL?</p> <p>Couldn't you simply add an additional controller to the &quot;Default&quot; routing...what purpose does it serve in giving each route a distinct name in this tutorial?</p> <p>A route can have multiple controllers so is the one that is specified in the MapRoute() method simply the default controller? I notice in the following tutorial that the route/controller names in the tutorial are the same. Is that a good idea?</p> <p></p> 2013-05-22T16:42:40-04:002013-05-22T16:42:40.623-04:00urn:uuid:00000000-0000-0000-0000-000005386238http://forums.asp.net/p/1904239/5386238.aspx/1?MVC+AJAX+Not+SHowing+in+search+enginesMVC/ AJAX Not SHowing in search engines In January, we launched a new site and am having difficulity getting it to be indexed properly by the searh engines. &nbsp;Since the site is built in MVC and uses AJAX heavilly, I am wondering if this could be part of my problem. &nbsp;Google has indexed the top pages of the site, but none of underlying content, which is updated nightly. &nbsp;We ar in real estate with properties constantly coming on and off the market. &nbsp;Can someone please look at our site and tell me what I am missing? &nbsp;And how to get these properties showing up on the search engines? Our site is PostMyProprty.biz 2013-05-07T01:01:35-04:002013-05-07T01:01:35.66-04:00urn:uuid:00000000-0000-0000-0000-000005402139http://forums.asp.net/p/1908781/5402139.aspx/1?Show+thousands+separator+by+CultureShow thousands separator by Culture <p>Hello,</p> <p>I am developing a website mainly in two languages (English and Dutch) I want for every number integer and decimal to displayed with separators. I have already display all values so I do not want to iterate over all of them and format the strings&nbsp;</p> <p>The code below show how I change from language to another in Global&nbsp;</p> <pre class="prettyprint">CultureInfo ci = (CultureInfo)this.Session[&quot;Culture&quot;]; if (ci == null) { string langName = &quot;nl&quot;; if (HttpContext.Current.Request.UserLanguages != null &amp;&amp; HttpContext.Current.Request.UserLanguages.Length != 0) { langName = HttpContext.Current.Request.UserLanguages[0].Substring(0, 2); } ci = new CultureInfo(langName); this.Session[&quot;Culture&quot;] = ci; } Thread.CurrentThread.CurrentUICulture = ci; Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(ci.Name); NumberFormatInfo nfi = (NumberFormatInfo)ci.NumberFormat.Clone(); nfi.NumberGroupSeparator = &quot;.&quot;; }</pre> <p>In last two lines, I am trying to force the Culture to display the separator but it does not work.</p> <p>Does anyone have a greate idea?</p> <p>Regards<br> <br> </p> 2013-05-22T11:32:22-04:002013-05-22T11:32:22.533-04:00urn:uuid:00000000-0000-0000-0000-000005388423http://forums.asp.net/p/1904751/5388423.aspx/1?How+do+I+provide+mobile+and+desktop+views+from+the+one+controller+How do I provide mobile and desktop views from the one controller? <p>Hello,</p> <p>Apologies if this question has been covered before, but having spent ages searching, I haven't found a clear answer.</p> <p>I have an ASP.NET MVC3 web site that works fine on a desktop screen, predictably looks squashed on a mobile device. I want to adapt it so that it works well on either.</p> <p>I have seen that MVC4 has built-in support for serving different views based on the device, but I'm not clear how to go about it. Woudl anyone be able to answer the following...</p> <p>*) Will the MVC4 for VS2010 SP1 give me all of the features of MVC4? I'm using VS2010 for the existing project (and can't upgrade it right now), so this is important.</p> <p>*) How do I upgrade the MVC3 site to use MVC4 so I can take advantage of the new features?</p> <p>*) Once I have it working in MVC4, how do I go about delivering different views for desktop and mobile devices?</p> <p>*) Not specific to MVC, but is there an easy way to see what the site woudl look like in (say) an iPhone, a Blackberry etc without having to deploy it and try it out for real?</p> <p>Thanks for any help.</p> 2013-05-08T17:54:48-04:002013-05-08T17:54:48.313-04:00urn:uuid:00000000-0000-0000-0000-000005402130http://forums.asp.net/p/1908777/5402130.aspx/1?MVC+Controller+and+Ajax+Call+to+update+tableMVC Controller and Ajax Call to update table <p>I am trying to render table data through a PartialView using an Ajax call.</p> <p>Controller (higly simplified) the GetData does return valid data.</p> <pre class="prettyprint">[HttpPost] public JsonResult UpdatePreviousNamesGrid(int id) { return Json(_repository.GetData(id)) }</pre> <p>Script</p> <pre class="prettyprint">&#36;('#AddPrevOpName').click(function() { var addPreviousOperatorNameButton = &#36;(this).val(); var responseData = &#36;('#tableData'); &#36;.ajax({ url: '/Application/UpdatePreviousNamesGrid', type: 'post', data: {id: 20}, success: function (outData) { //?? } }); });</pre> <p>How do I get the data being returned and turn it into table rows?&nbsp;</p> <p>The data being returned looks like:</p> <pre class="prettyprint">[{"AOLNameID":1,"AOLHeaderID":20,"Name":"Old Name","DateFrom":"\/Date(1305638823803)\/","DateTo":"\/Date(1368797223803)\/","Created":"\/Date(1368797223803)\/","CreatedBy":21}]</pre> <p><br> <br> </p> <p><br> </p> <p></p> 2013-05-22T11:23:42-04:002013-05-22T11:23:42.417-04:00urn:uuid:00000000-0000-0000-0000-000005402358http://forums.asp.net/p/1908826/5402358.aspx/1?Action+with+many+parametersAction with many parameters <p>Hi</p> <p>&nbsp; In MVC normally while application development if we have action with different parameters, while specifying routing without giving all the parameters can we specify as *catchall</p> <p>&nbsp;</p> <p>Regards</p> <p>Rajesh Kumar.C</p> <p><span face="TheSansMonoConBlack" size="1" style="font-family:TheSansMonoConBlack; font-size:xx-small"><span face="TheSansMonoConBlack" size="1" style="font-family:TheSansMonoConBlack; font-size:xx-small"></span></span></p> 2013-05-22T15:02:00-04:002013-05-22T15:02:00.497-04:00