URL route Catch all
Hi, I wondering if there is anyway to achieve a url like http://www.mycompany.com/user in MVC I tried using the catch all but could not get the user passed so I can do the look up. Thanks ...
Hi, I wondering if there is anyway to achieve a url like http://www.mycompany.com/user in MVC I tried using the catch all but could not get the user passed so I can do the look up. Thanks ...
I have my Html Textboxes created so that they will be bound to a custom view model when posting back to the server. <%= Html.TextBox("CustomerFormViewModel.Email")%> This works great if it's a traditional POST. I can then receive it on the Controller side with something like this: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Add...
I'm trying to set up Route mapping tests using MVC Contrib as described in Test ASP.NET MVC routes using MVC Contrib The tests compile and execute, but they always fail with the message "The URL did not match any route." I set up another test to try to get an idea of what the problem is: Public Sub TestIndexRoute() Dim ro...
In my MVC app I have one action available on a public side so everything looks like http://www.domain.com/pagename When it goes to the action method of my WebPageController it finds it in the DB by pagename and renders the View. In the View I do a database call to a foreign key table called WebPageContent. For each WebPageContent I do ...
MVC's BeginForm helper uses the Request.RawUrl property when crafting a form's action. I'm sure this is generally fine but it is causing an issue for me. I use a URL rewriter on my site. In the global.asax I have the following code to straighten out the rewriter's actions. protected void Application_BeginRequest(object sender, EventA...
I have a custom authentication HttpModule that is pretty strait forward. But I want it to run only for managed requests (and not for static ones). Asp.net MVC automatically adds configuration section for IIS7 web server: <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesFor...
At the moment to set a page title you have this on the Master page <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title> I also want to have the same principal for MetaKeywords and MetaDescription however I don't think this is correct: <meta name="description" content="<asp:ContentPlaceHolder ID="ContentPlaceHold...
Why I'm having this error "Object of type 'System.UInt16' cannot be converted to type 'System.Int16" when I'm trying to run below code public ActionResult List() { var x = account.All(); return View(x); } The errors showed up, when it's try to iterate my model in my List.aspx file (below code). <% foreach (var item in ...
Original title: Can't fixed misconfigured routes I want to make a search based in a filter (with 4 possibles values) and a criteria entered by the user. I have the following routes: routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "SubLineasProductosDefault", "SubLineas...
I'm in the middle of an ASP.NET MVC project and recently installed the free trial of ReSharper 4.5. Immediately I realized the benefits, simply because of the refactoring it wanted me to do. Things like inverting if statements to reduce nesting, changing some of my if/else statements that were returning Views to ?/?? operators - drastic...
In my current project, we have to create a website (ASP.NET MVC) which is likely to have sufficient load to demand a server farm. I understand that if server farm is used, session states must be stored on somewhere else such as SQL server database or state server. After some experimentation, we are inclined to use the state server mecha...
After reading the first 7 chapters of Pro ASP.NET MVC Framework -a very recommended read, i'd say. Throughout my reading, the author -Steve Sanderson, touched on some TDD practices a lot. Now my question is: Steve used to perform his unit tests against the controllers themselves, an example of the book: [Test] public void List_Inc...
I'm trying to find a better way to use a div table with ASP.NET MVC, the problem I see is that you need to do loads of looping, rather than one loop if I had to use a traditional <table> table. Example <div class="column"> <div class="row">Name</div> <% foreach (Person person in (List<Person>)ViewData.Model) {%> <div clas...
Hi, I am trying to call an ASP.NET MVC actionMethod via the JQuery ajax method. My code is as follows: $('.Delete').live('click', function() { var tr = $(this).parent().parent(); $.ajax({ type: 'DELETE', url: '/Routing/Delete/' + tr.attr('id'), contentType: 'application/json; charset=utf-8', da...
i have an AccountController that does the asp.net login and user registration. (Register action below.. After that is successful i also want to add this user data to another table of mind called users. Right now i have a "UsersController" and an action called "Create" so as you can see below i have the line: return RedirectToAction("C...
I'm using the Ajax.BeginForm helper in my MVC app. Here's a simplified example: <% using (Ajax.BeginForm("actionName", new { Controller = "controller" }, new AjaxOptions { OnBegin = "doValidation", LoadingElementId = "ajaxLoader" })) { %> The problem is that if the OnBegin...
I writing an MVC app and I'm really struggling to keep my controllers lean and limit the number of actions. For example, here is a look at my ReportController actions: OpenCall ClosedCall ServiceLevelAgreement Barrier Resolution Repair Failure Inventory CustomerLocation These are all my different reports. Should I be making a control...
I would like to pass a nested JavaScript object to my ASP.NET MVC Action Method. Here is the code(simplified): $.getJSON('some/url', { index: pageIndex, pageSize: pageSize, filter:{one:'one',two:'two',three:'three'} },someCallBack(msg) ); I'm...
I have a UserController and an Edit.aspx. There is one field that is my primary key so i dont want to allow users to edit this field. The issue is that if i remove the <%= Html.TextBox("Email", Model.Email) %> then when the asp.net-mvc magic calls my Controller code: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edi...
I'm building an application that roughly follows the repository pattern with a service layer on top, similar to early versions of Conery's MVC Storefront. I need to implement a page that returns all users except for the current user. I already have GetUsers() methods on the repository and service layers, so the question is where to appl...