All Questions
Tagged with asp.net-mvc-routing asp.net-mvc-4
614 questions
1
vote
1
answer
133
views
APS.NET MVC request routing using query parameter names
I'm trying to understand attribute routing in ASP.NET MVC. I understand how routing matches on url elements, but not query parameters.
For example, say I have a rest-style book lookup service that can ...
0
votes
1
answer
183
views
Why is MVC attribute routing not matching this GUID?
I'm trying to use attribute routing. For various reasons, one of my Guid argments required for a password reset must not be in the queryString so I've had to put it in the path. That itself isn't a ...
0
votes
1
answer
36
views
Unable to get webApi result in controller
I am trying to create constraint for route.Based on the access info retrieved from Db,i will choose which route to choose.
I have created controller inheriting IRouteConstraint and calling repository,...
0
votes
1
answer
353
views
how to Create Url in mvc4
custom route is not working in my case
i am trying to Create a URL in mvc4.
Route url:-
routes.MapRoute(
name: "DocumentDetails",
url: "DocumentDetails",
...
0
votes
0
answers
150
views
Default route in MVC project with areas
I have an ASP MVC 4 project which contains areas and is structured as follows:
Areas
MyArea
Controllers
MyAreaController.cs
MyAreaRegistration.cs
Controllers
HomeController.cs
Global.asax
In Global....
0
votes
1
answer
69
views
Server Error in '/' Application in MVC 5 application
I am currently learning MVC 5 by watching video tutorials. I have created one simple customercontroller with two action methods i.e. (AddCustomer and Submit). Here i have created one simple view for ...
1
vote
1
answer
612
views
Attribute Routing over Convention-based Routing in MVC, which one would be called first?
I am assuming that the convention routing would be added to the route table first because it is getting registered in the global.asax file like this
RouteConfig.RegisterRoutes(RouteTable.Routes);
Now ...
0
votes
1
answer
75
views
ASP.Net Routing: Customer ID not passing to action
see my url localhost:55831/Customers/Edit/1/ALFKI which i generate using @Html.RouteLink
@Html.RouteLink("Edit", "PageWithId",
new
{
controller = "Customers",
action = "Edit",
id = item....
-1
votes
1
answer
250
views
MVC Custom Attribute routing with City and Country URL
I want to create custom attribute routing in MVC, where I want my URLs like this :
www.domain.com/in/best-restaurants-in-india // FOR COUNTRY INDIA
and
www.domain.com/in/best-restaurants-in-new-...
0
votes
1
answer
223
views
Optional middle parameter in MVC4 Route
I am trying to create a controller action that receives several parameters for filtering a scope and then the final parameter is a required paging parameter for paging the results.
//Example Action
...
-1
votes
1
answer
31
views
MVC 4 routing to a controller
I am new to MVC and I am trying to mess around by creating a practice site which will be a gallery site for viewing and uploading images. The problem I encountered is that I cannot get the routing to ...
0
votes
1
answer
936
views
Map Web Api MapHttpRoute to Base Url
Hi I have a Controller as shown below,
[RoutePrefix("")]
public class ApiInformationController : Controller
{
public ActionResult Index()
{
var info = new ApplicationInformation
...
0
votes
1
answer
379
views
Posting form to different controller action not working in MVC
I have defined the default route in the RouteConfig.cs which show below:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"...
0
votes
0
answers
594
views
Custom routes rendering with Html.BeginRouteForm
I'm using custom route mapping in following way:
context.MapRoute(
"CustomRoute",
"Area/{controller}/{id}",
new { controller = "Task", action = "Index", id = UrlParameter....
0
votes
2
answers
104
views
Change application behaviour based on whole URL
This might sound like a strange one. I'm hoping to have two identical instances of an application behave differently based on the URL used to access them.
I have two instances of the app deployed on ...