3
votes
0answers
500 views

How to define a catch (absolutely) all route in ASP.NET MVC 4

I would like to define a catch all all route that catches all requests. I've tried the following route definition: routes.MapRoute("CatchAll", "{*stuff}", new { controller = "Proxy", action = ...
2
votes
0answers
150 views

ASP.NET Catch all routing and escaping forward slashes

I'm using catch-all routing with MVC to provide a path to a resource in our application. It looks like such: _routes.MapRoute(null, "Resource/{*resourcePath}", new { controller = "Resource", ...
2
votes
0answers
229 views

How to prevent not found error when image doesn't exist in .NET MVC

I have an MVC application and my error handling is set up like this in web.config: <customErrors mode="On" defaultRedirect="~/Error/" redirectMode="ResponseRedirect"> <error ...
2
votes
0answers
483 views

routing issue on nopCommerce 2.3

I'm having problems debugging what I think is a routing issue on nopCommerce 2.3. Both the sitemap and search pages redirect to the homepage instead of their respective pages. This is the code in the ...
1
vote
0answers
23 views

Routing table for multilingual web site

I am trying to make a multilingual ASP.NET MVC site. Here is how I need the URLs to look like www.mysite.com/home -> must be English and call Index action of the Home controller ...
1
vote
0answers
34 views

asp.net mvc routing depending on session

I have an ASP.Net MVC site and I want that every request to images of my site /images/image_name.png are redirected to /images/{skin}/image_name.png where {skin} is session dependant. and I ...
1
vote
0answers
60 views

Redirect to different URL in MVC4

How to pass value url value in RedirecttoAction with Controller and Action with parameters. Condition On Post of an action in site1 (https://www.xyz.com), redirect to site2 ...
1
vote
0answers
89 views

MVC Controller to get image with ChildActionOnly

I want to display an image for a shopping cart item that is stored in my database. I got 90% to what I wanted by following this SO post. My view has an image like this: <img alt="@item.Name" ...
1
vote
0answers
48 views

How to distinguish between two routes: one for parameterless action and one for the index action with one parameter?

I have a controller with multiple actions and I set up the following routes: routes.MapRoute( name: "MyCustomRoute", url: "MyTarget/{option}", defaults: new { controller = "MyTarget", action ...
1
vote
0answers
307 views

Links from OWIN hosted WebApi to MVC and vice versa

I want to generate url from mvc view to WebApi controller and from WebApi to MVC action. Normally these methods work perfectly: // mvc to webapi @Url.HttpRouteUrl("DefaultApi", new { controller = ...
1
vote
0answers
117 views

Multi tenancy bundling minification caching issue

I'm struggling while implementing the bundling and minification framework to my multi tenancy application. For the sake of simplicity here's a little example: have the following routes configured: ...
1
vote
0answers
162 views

MVC routing requiring “.cshtml” in URL

I have an MVC4 website running fine on dev. When trying to publish to production routing doesn't work. The only rule I have is the default: routes.MapRoute( name: "Default", ...
1
vote
0answers
72 views

Asp.net MVC route mapping query

The default route map specified in MVC is: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = ...
1
vote
0answers
114 views

Dot at the end of URL causes unhandled error

I am trying to customise the error pages in the MVC4 application using two approaches: 1.I've covered the case for Application_Error: RouteData routeData = new RouteData(); ...
1
vote
0answers
495 views

Wrong redirection while using authorize attribute. Redirects to account/login instead of account/logon

I am facing an un-recognized error in Asp.net MVC 3.0 while using authorize attribute. accountController public ActionResult LogOn() { return View(); } testController [Authorize] ...
1
vote
0answers
141 views

asp.net mvc route with action after id and slug

I'm adding a new route into my mvc web application and it's not working as desired. I was hoping someone could help me figure out where in the list it should go and maybe which defaults and/or ...
1
vote
0answers
151 views

How to set default ApiController in HttpConfiguration.Routes?

the api routing configuration from the template is this: public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute( name: "DefaultApi", ...
1
vote
0answers
136 views

Error in production only when the user first hits the login screen

In production only, when the user hits our login screen we get the following elmah eror System.NullReferenceException: Object reference not set to an instance of an object. Generated: Wed, 24 Apr ...
1
vote
0answers
131 views

ASP.NET MVC Routing issue with action parameters

I'm fairly new to MVC4, and I'm having a problem getting a custom route off the ground. I don't want to explain what my end goal is, since it's fairly complicated, but right now I simply want this ...
1
vote
0answers
214 views

routing mvc app with attribute routing

I have started working with AttributeRouting for MVC4 application to manage its routes and I must say its an excellent library. I am very impressed with the localization feature with it where I can ...
1
vote
0answers
213 views

ASP.NET MVC - Creating a custom Uri to Route mapping handler

I'm looking to heavily customize the way my application handles Routes. Essentially, I want to achieve a process something like this: User requests URL: ...
1
vote
0answers
553 views

MVC Routing to use optional subfolder (like a set of virtual directories)

Here's the problem that I have been tearing hair out over since Friday. I have a single MVC application that serves several different subgroups for a single client. For branding and for some style ...
1
vote
0answers
261 views

MVC IRouteConstraint Entity Framework performance

I am trying to make my MVC application as efficient as possible. I have just come across the following problem which I am not sure could be solved in Entity Framework or MVC. I have the following ...
1
vote
0answers
329 views

MVC ActionResult

I have a controller named ToolsController. This controller has an ActionResult GetName which returns a string ("Hello name"). I was able to hit the ActionResult like this ...
1
vote
0answers
100 views

What is best practice for building custom routing (.Net MVC)?

The short story is that I want to create a web app that is similar to a CMS/blog. The thing is that it has a page hierarchy (domain.com/x/y/z/) and it exists several controllers. I need something ...
1
vote
0answers
178 views

Problem with asp.net mvc routing

I have the following project structure UserController code: public class UserController : Controller { public ActionResult Login() { return ...
1
vote
0answers
388 views

publish asp.net upgraded to 4 and using MVC routing. Access denied

I have upgraded my asp.net 3.5 app to 4.0 and added support for routing (added dlls are made "copy locaL"). It works perfectly locally. After deployed to IIS7 (using FileSystem publish method in ...
1
vote
0answers
1k views

ASP.Net 4 routing and subdomains

I'm developing a site with ASP.Net 4 which uses routing extensively. it displays pages for each client depending on the route data. http://localhost/abc/manage/posts/ redirect to posts page of abc ...
1
vote
0answers
871 views

ASP.NET MVC hosting problem, routing, handlers and modules

This is one of them again, hosting with fasthosts. I recently purchased a windows developer package from them. When I tried to deploy my ASP.NET 3.5 MVC project, which was working fine with the same ...
1
vote
0answers
212 views

Show breadcrumbs when Passing GUID

I'm working with ASP MVC 2 RC2 and using the standard sitemap provider. I'd like to show breadcrumbs on a page which passes a guid in the url e.g. /validate/GUID but i'd like the system to ignore ...
1
vote
0answers
85 views

Why are my Outbound URLs in NUnit different from the ones in my View?

I'm reading Pro ASP.NET MVC Framework book. In an example on 106 - 111 the author walks through creating an NUnit test for a HTMLHelper class. I noticed that when I ran my HTMLHelper code in NUnit ...
0
votes
0answers
7 views

Asp.net MVC 4 URL or routing issue

I'm using asp.net MVC 4 to create a website. in the route.config file I have the following defaults: new { controller = "announcement", action = "index", id = UrlParameter.Optional } so when I ...
0
votes
0answers
10 views

Get request controller name in view; not current controller rendering view

I have the following in a view: var controllerName = ViewContext.RouteData.Values["controller"].ToString(); if (controllerName == "whatever") { // process } However, this view is rendered by ...
0
votes
0answers
9 views

link to a folder in mvc not working in chrome and ff

I have a link in my MVC webpage. <a href="\\folder1\folder2" target="_blank">folder</a> when I click on it , it works in IE8. But in chrome and firefox it is not even going anywhere. ...
0
votes
0answers
21 views

ActionLink adding useless “Home/Index/” to href when linking to default action in areas

While this is admittedly a minor detail, I'm wondering why HtmlHelper.ActionLink acts differently when generating hrefs for actions in areas compared to the default "area" (i.e. controller actions not ...
0
votes
0answers
28 views

MVC5 EF, Routing does not work the same for all views

I have created a project following this tutorial: http://www.asp.net/mvc/tutorials/mvc-5/database-first-development/changing-the-database. The tutorial leads for a database first application using MV5 ...
0
votes
0answers
17 views

How to add # at the end of route in MVC Routing

I have a default route defined as routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = ...
0
votes
0answers
16 views

Cannot display newly created view on publishing the site MVC 4

I have created a new view in existing MVC 4 project. The page redirects locally but when I publish it on server it gives error as Page Not Found. Following is stack trace for the same. ...
0
votes
0answers
37 views

MVC Response.RedirectToRoute(RouteData.Values) redirects to the Area controller

I use RedirectToRoute method to force culture in the url. All was working until I create an Admin area in my project. Now the method redirects to the Area controller. Example with the main ...
0
votes
0answers
13 views

asp.net mvc: multiple routing for a view

i have a view: list and an action result: Index and two routing rules for this view routes.MapRoute( name: "List_A", url: "list/{page}", defaults: new ...
0
votes
0answers
28 views

No route in the route table matches the supplied values

I have 3 routes that are in my routing table. The second route in the table is as follows based on the my code in the AreaRegistration class: context.MapRoute( "Contests_default", ...
0
votes
0answers
18 views

How to add custom route what routes to existing folder ASP.MVC

I have MVC project with standert folders, but I need to add custom folder what wil act the same as Scripts or Content. In other word - I need to serve files and folders in this folder in the same ...
0
votes
0answers
9 views

MVC 4 Can't edit after changing routing logic from controller

I needed to effectively change the route from the id field to another field (mkt). Here is an example of how I did that. public ActionResult Details(string id) { Order order = ...
0
votes
0answers
44 views

Routing of test.html file -MVC return 404

My target is redirect request requsting test.html to test2.html by user agent, Im using MVC so i was following this article So in my /App_Start/RouteConfig.cs is : routes.RouteExistingFiles = true; ...
0
votes
0answers
70 views

ASP.NET MVC app routes breaking when rewritten through IIS URL Rewrite

My site, an ASP.NET MVC app is behind a reverse proxy that dispatched requests to mysite.com/subdirectory/anything where subdirectory is added by the proxy for some identification purposes. I've set ...
0
votes
0answers
31 views

Removing a Route parameter from an ActionLink in MVC4

I am having a bit of a problem with a RouteData Value lingering in my View and making my @Html.ActionLink(...) look a bit ugly. In my routes I have this: routes.MapRoute( name: "SubItemLinked", ...
0
votes
0answers
23 views

MVC Subdomain Routing

I have an existing application with a lot of available normal and generic routes. Example route: routes.MapLocalizedRoute("HomePage", "", new { ...
0
votes
0answers
27 views

Accessing/Modifying URL Before MVC Router

We have an existing web application on asp.net mvc on IIS 7 with all the routing rules ready and working. Now we decided to encrypt urls (not just querystring, entire path) using a random generated ...
0
votes
0answers
27 views

Application routing mechanisms

I have been studying the ASP .NET MVC's routing mechanism, as to how the request decides which controller's action method to call with arguments and how separation of concern is used with models and ...
0
votes
0answers
59 views

C# get Session-Value in .net MVC-RouteHandler

I would create a dynamic routing in my ASP.Net – MVC Project (Framework 4.5.1). To do this I create a custom MvcRouteHandler which work fine until I tried to add a new condition in base of a ...