I've got the following routes:
// Submission/*
routes.MapRoute(
"Submission",
"Submission/{form}",
new { controller = "Submission", action = "Handle", form = "" });
// /<some-page>
routes.MapRoute(
"Pages",
"{page}",
new { controller = "Main", action = "Page", page = "Index" });
The first routes requests exact...
I have this in my Global.asax.cs:
routes.MapRoute("BetaAccess", "beta-access", new { controller = "Beta", action = "Index" });
And this in my controller (index action on HomeController) and it definitely is getting hit:
RedirectToRoute("BetaAccess");
But still no redirection happens... it just goes to the normal home page. Am I usi...
Hi, this question is related to routing-filter.
I have this in my view:
<% form_for :post, :url => {:action => "show"} do |f| %>
which translates in the browser to this:
<form action="/en/posts/show" method="post">
after changing the I18n.locale e.g.
I18n.locale = :en
the html becomes:
<form action="/en/posts/72" method="post"...
Hi,
I'm generating sitemap.xml for google.
I have also the Sven Fuchs' routing-filter excellent plugin.
But all links look like this one -
http://localhost:3000/en/posts/54
Is there any way to switch the locale in the same "view"?
Thanks.
...
I have a bunch of expired content at URLs all ending in .html from a legacy static HTML site:
example.com/a.html
example.com/b.html
Rather than display a Rails error page that says:
Routing Error
No route matches "/a.html" with {:method=>:get}
I want to reroute all content that ends in .html to the homepage (the root route):
map.r...
Hi, I've been using this some while now, but I can't seem to figure out, where could be mistake in this simple code:
<a href="<%= Url.Action("Page", new { page=(Model.PageIndex + 1) }) %>" >a</a>
With this routing table:
routes.MapRoute(
"Paging",
"Home/Page/{page}",
new { controller = "Home", acti...
Is it possible to map a subdomain to a resource? I have a company model. Currently, using subdomain_fu, my routing file contains:
map.company_root '', :controller => 'companies', :action => 'show',
:conditions => { :subdomain => /.+/ }
My Company model contains a "subdomain" column.
Whilst this works as inten...
One of the great things about ASP.NET MVC is the routing engine. I love to generate my urls and not having anything break when I change the routes.
However, I'm not sure how I can apply this mechanism on the client side.
Let's imagine a common scenario where I have two dropdown lists and the content of the second list depends on the se...
Hello everyone,
in order to estimate the execution time of the requests sent to my mvc applications, i've been using log4net to log the time elapsed in the EndRequest event of global.asax for my MVC application.
However, the EndRequest is called for every request, including the resources (css, images); i'd prefer to be able and distingu...
This might be a tough one
I have a site which is using a polymorphic comments model.
Lets say the first model is library, and the second is book
so we have, library/1/book/63/
how do I route it so comments are then library/1/book/63/comments/1 ?
Thanks,
Elliot
update: looking for code for routes.rb file
...
Consider a PersonController which has a list action. A user can choose to list all people, or only males or females; currently, to do that, they'd have to go to /people/m or /people/f, corresponding to the route
map.list_people "people/:type",
:conditions => { :method => :get },
:requirements => { :type => /a|m|f/ },
:defaults => ...
Whenever .NET routing is included in my web.CONFIG i get a sys undefined error which prevents ajax from being loaded.
I'm using .net 3.5 w/ c#
any help would be much appreciated.
...
Say I have 3 versions of a website: A, B and C. I want my urls to be of the form:
{siteType}/{controller}/{action}/{id}
where siteType equals a, b or c.
When the user is in the A version of the website, then they should stay there; therefore all generated urls should have a siteType of a. Similarly for B and C.
I don't want to have ...
Suppose I have the following actions:
public ActionResult DoSomething()
{
// Some business logic
return RedirectToAction("AnotherAction", RouteData.Values);
}
public ActionResult AnotherAction(string name, int age)
{
...
}
And the following form:
<form method="post" action="DoSomething">
<input name="name" type="text"...
I have a weird problem with routing. I have an existing website that I am trying to add this to. It works, but only if .aspx is on the end of the URL. If I remove the .aspx, it gives me an error: "The resource cannot be found." I created a quick test website and copied the code over to it, it works just fine. The code between the 2 a...
I'm still new to ASP.NET MVC and I'm struggling a little with the routing.
Using the ASP.NET development server (running directly from Visual Studio), my application can find its views without any problems. The standard ASP.NET URL is used - http://localhost:1871/InterestingLink/Register
However, when I publish my site to IIS and acces...
hello,
I am writing a URL Slug for routing. Should I leave the slug constraint blank or what?
Here is my code:
routes.MapRoute(
null,
"q/{slug}/{id}",
new { controller = "q", action = "Index" },
new { id = @"^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-f...
Is there an article somewhere explaining exactly how the route matching works, and what it is capable of?
for example, how would i write a route to catch everything?
so:
/
/something
/something/else
/something/else/again
all get mapped to the same controller action, with the url as a parameter?
{*anything}
doesnt seem to work. ca...
Hello, this is my first post on this website, but I'm all the time getting answers for my questions here, through other users, so thank you very much.
Well, actually I'm creating a web application, specifically on rails.
All the models structure were built and now I was pretending to start to build the controllers and routing. So, I hav...
I have an MVC website I've been developing and I now wish to move up to my shared hosting service. However, I've run into a bit of a problem: my provider only allows for 1 root level application.
When I created and application as a sub of my root application, my MVC app wouldn't work. I'd either get a "resource not found" or, after adju...