Hi,
I have a page routed like /Comments/Search/3 where i search and display all the comments of the thread "3".
I'm adding a sort function (by date, author etc). What is the best way to handle it? /Comments/Search/3/Sort/Author or /Comments/Search/3?sort=author ?
How do I automatically handle the querystring sort=author as a parameter ...
We have a really old legacy code base that uses globals like they're going out of fashion - nearly all of the inter-page communication is done via globals and sessions or both. This could be changed as a last resort but ideally I don't want to touch any of it as everything I touch could introduce more bugs :-p.
Anyway, We're incorporati...
Hi, I have a problem with transfer of my project to iis server. At the asp.net development server all routing went smoothly. Now i want to migrate to iis server and my onchange attribute on select tag doesnt work. When i try to get from https://www.web.com/Manager/Authorized/Accounts/0 using the
onchange="location.href='<%= Manager.MyCo...
I am building a URL inside of a class and I'd like to be able to change the routing if necessary later by just changing the routing.yml file.
If I have the route:
userSignup:
url: /user/signup
param: { module: user, action: signup }
How can I use the url_for('userSignup') helper in a class to dynamically create the URL?
...
I created a new ASP.NET MVC project and implemented a site authorization filter.
When I map the routes to the {controller}/{action} pair, I pass a role = "SomeRole" default to the route.
It works perfectly if I go through the full url (http://localhost/somecontroller/someaction) and I specified the full route
[ MapRoute("SomeAction",...
I got web app which uses ms mvc. I'm still living in stone age - using IIS5. I'm not aware how to make URL`s clean in it (without .aspx postfix) and i do not care, cause production environment won't use 5th version. But it's irritating when testing app manually.
I need a way how to make those URL`s clean or to get version of IIS inside ...
When using ASP.Net routing, how can you get the RouteData from the code-behind?
I know you can get it from the GetHttpHander method of the RouteHandler (you get handed the RequestContext), but can you get this from the code-behind?
Is there anything like...
RequestContext.Current.RouteData.Values["whatever"];
...that you can access ...
I have a mystifying problem. In a very simple Ruby app i have three classes: Drivers, Jobs and Vehicles. All three classes only consist of Id and Name. All three classes have the same #index and #show methods and only render in JSON or XML (this is in fact true for all their CRUD methods, they are identical in everything but name). There...
Hi folks,
I'm trying to create a route and then programatically retrieve the url of that route (so i can pass it to my jquery-rater.js code).
So, i wish to have the following url: /vote/create
The user will need to HTTP-POST to it. Posting the two values:
1. PostId
2. Vote Score (byte from 1<->5).
This is my route info:
routes.MapRou...
I have a typical artist has_many songs model and I'm trying to set up the nested resource in Rails.
My routes.rb looks like this:
map.resources :artists do |artist|
map.resources :songs
end
This works fine for the artist paths, but when I want to link to the songs controller, like this:
<%= link_to artist.name, artist_songs_path(...
routes .Add ("Detail",
new Route ("{maincategory}/{category}",
new RouteValueDictionary (new { controller = "Category", action = "Detail"}),
new RouteValueDictionary (new { category = new FromValuesListConstraint ("")}),
new MyRouteHandler ()));...
I am just starting to learn ASP.NET MVC and I have a situation where I have two URLs which I would like to point to the same view.
For example I could have http://some.domain/reports/daily/team1 and http://some.domain/team1/reports/daily. Could I then point them to the same view as the request is obviously the same?
The reason I am ask...
I´m developing an ASP.NET Web Application and want to use the ASP.NET Routing Engine (System.Web.Routing) with it.
My Application works fine in Cassini, but when I start it in IIS7 (Integrated Application Pool, of course) I always get an error on this line:
User.Identity.IsAuthenticated
What could be the reason for this? Is there an...
Do you prefer...
1- Write the whole application, then set up routing/url rewriting
2- Set up routing as you go
3- Write most of the application, set up routing then maintain the routing
4- Set up the routing then write the application
5- Write the main routes first, then maintain them as development goes
I see advantages / drawbac...
I have a partial view:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DomainModel.Entities.Product>" %>
<div class="item">
<h3><%= Model.Name %></h3>
<%= Model.Description %>
<% using (Html.BeginForm("AddToCart", "Cart")) { %>
<%= Html.Hidden("ProductID") %>
<%= Html.Hidden("returnUrl", ...
I've been playing with ASP.Net MVC for a while now. I found the most difficult thing to get right is the routing table.
I found most examples leave the default route in place. I found that this leads to a lot of errors where the default route redirects to HomeController with an action that doesnt exist. Leading to strange error messages...
Let's say I have an image that does not reside in the normal location:
{appname}/public/images/unconventional.gif
But instead here:
{appname}/unconventional.gif
I understand this is a complete violation of Rails conventions, is immoral and you should never do this under any circumstances and, furthermore, why would I even suggest s...
Morning Everyone!..
General Routing Quesiton Here... I'm currently working to achieve a route similar to this for users in my application.
http://www.example.com/username
This then maps to the usersControllers#show, hence I have the following in my routes file.
map.connect '/:permalink', :controllers => "users", :action => "s...
I'm migrating a ASP classic site to ASP.net MVC.
Is there a way to redirect the old traffic to the new one?
Example: how to go from:
www.mydomain.com/viewpage.asp?pageid=1234
to:
www.mydomain.com/page/1234
...
Hi, I am trying to create a subdomain using the Zend Router, and then for each section under a subdomain, such as subdomain.site.com/section/ I am creating another route and then trying to chain it to the subdomain route. but I don't know how. I have read all the documentation I could find and all the forums, but it leads me to figure i...