I want to have a route that looks something like: www.abc.com/companyName/Controller/Action/Id
However, all the company names need to map to the same "base" controllers, regardles of what the name is. I only need the companyName for authentication purposes.
Also, if there's no companyName provided, I need to map to a different set of co...
When any URL is 404 on my site, i want to show a custom 404 page that is rendered with ASP.NET-MVC. Hoewever i do not want to use the wildcard route approach because that would disable standard webforms. My code currently looks like this:
if (serverException is HttpException && ((HttpException)serverException).GetHttpCode() == 404)
{
/...
I have a controller "manage_links.rb" that allows users to manage their links, which have a corresponding "link" model. I am getting the following error:
ActionController::RoutingError in Manage_links#index
Showing app/views/manage_links/index.html.erb where line #16 raised:
edit_manage_link_url failed to generate from {:controller=>...
Hi
I want to do the following:
The user should have his own sub site on my web site. Therefor I've added a new route:
routes.MapRoute(
"ShopEntered",
"{username}/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
When the site gets called for the first time I want to store the username...
When routing resources in Rails the optional format attribute is automatically appended to the generated routes. This is so that the resource in question can be requested as either XML, HTML etc. Which formats that is actually allowed is usually described in the controller using respond_to.
But in many cases you only want to support HTM...
Has anyone had any experienced with making language dependent routes with ASP.NET MVC? What I would like to do is have localized url's to improve SEO. So for example http://mysite.com/products/cars would map to the same controller/action as http://mysite.com/produkter/bilar?
I have tried browsing around a bit, but I could not find anyth...
By default, the MVC Authorize attribute sets the HttpContext.Response.StatusCode = 401 when a user is not authorized and the section in the web.config routes to the loginUrl property.
I want to do something similar with other response codes. For example, I have an attribute called ActiveAccount which verifies the user's account is cur...
Im having a really hard time understanding routing.
Please help me with this problem.
Each of my controllers have these three actions right now
Users have Index, Create and Edit
Locations have Index, Create and Edit
Companies have Index, Create and Edit
The thing is, it all gets done through ajax.
I have jquery ui tabs with two t...
Currently my URL structure is like this:
www.example.com/honda/
www.example.com/honda/add
www.example.com/honda/29343
I have a controller named HondaController.
Now I want to refactor this so I can support more car manufacturers.
The database has a table that stores all the manufacturers that I want to support.
How can I keep my URL ...
My route looks like:
routes.Add(new Route("{companyName}/{action}/{id}", new MvcRouteHandler())
{
Defaults = new RouteValueDictionary(new { controller = "CompanyController", action = "Index", id = 1 }),
}
);
my action:
public ActionResult Index(string companyName, string id)
{
Response.Write(companyNam...
I have my index page which posts a single entry instead of the usual scaffold default of all of the entries. I told it to link to an action and it just responds to "Couldn't find Post with ID=all". It is the same as the default index method and index view. I assume this has something to do with routing but being no I have no clue. Any id...
I am using ASP.NEt MVC for one of my project.
In this I have Employee controller which can be called by www.Mysite.com/Employee/ url.
Also I have used JqGrid which uses followng to fetch data
url: "GetGridData"
While testing the same I found that
If i type www.Mysite.com/Employee/ in browser a call is made to
www.Mysite.co...
I have an existing ASP.NET website with some custom routing, within a Solution that also contains Business Logic projects.
I want to create a new project within the Solution, which is an ASP.NET MVC website.
This website will also call the Business logic, and the ultimate aim is to port most of the code from ASP.NET to ASP.NET MVC.
Bu...
I have a User model. If I do:
def my_action
@user = User.new
end
then
<% form_for(@user) do |f| %>
I get
undefined method `users_path' for #<ActionView::Base:0x1b4b878>
Which make sense because I haven't mapped it going map.resources :users... but I don't want to do it this way because I don't need all the resources.
How ca...
i put this in Global.asax.cs
routes.MapWebFormRoute("Page", "Page/{*anything}", "~/Page.aspx", false);
how i can get value of {*anything} in Page.aspx
i'm using WebFormRouting from codeplex
...
We have several pages of our site indexed using old non-SEO friendly URLS such as http://www.domain.com/DocumentDetails.aspx?id=555. Recently we implemented routing that uses slugs stored in the database and looks up the slug to forward you to the right page using routing, for example: http://www.domain.com/Documents/Title-of-the-Documen...
What would be the most appropriate route for this URL?
www.mysite.com/searchkey0
www.mysite.com/searchkey1
Where searchkey is the keyword for a search method? I tried the following route:
routes.MapRoute( _
"SearchRoute", _
"search", _
New With {.controller = "Search", .action = "Search", .id = ""} _
)
...
Please help me in coding for controller and support for URL Routing for PHP MVC framework.
...
I have been looking for a simple answer to this for a ridiculously long time and it seems like this has to be so plainly obvious and simple because no one has an easy, idiot proof tutorial.
Anyway, all I want to do is to have a single 404.html static page that loads whenever ANY error is thrown. Ideally this should only happen in produ...
While learning Rails I've created an application with a Domains controller nested below a Customers controller. I'm using Rails 2.3.4 and it's been a learning experience. I managed to get the below routing set up:
customer_domains GET /customers/:customer_id/domains(.:format) {:controller=>"domains", :action=>"index"}
...