I'm already thinking about to start using simple GET string.
Or I'm not so good at configuring routes? :)
And configuring routes via regex in .htaccess
foreach($links as $a)
{
$Router->addRoute($a['link'],
new Zend_Controller_Router_Route(
$a['link'] . '/:page/:ad_id/:photo/:price_from/:price_...
Hi,
I've got the following route:
routes.MapRoute(
"Search",
"Search.aspx/l-{lID}/t-{tID}/p-{pID}/s-{sID}",
new {
controller = "Search",
action = "Search",
lID = "",
tID = "",
pID = "",
sID = "" },
new { lID = @"\d{0,}",
tID = @"\d{0,}",
pID = @"\d{0,}",
sID = @"\d{0,}" }
);
Which works fin...
If I have a route with the following
{controller}/{action}/{id}
and I look at the following URL
c1/a1/abc.
it doesn't work. This only happens when the period is at the end of the URL. Any way to get ASP.NET MVC to recognize that as part of the ID?
...
Are there any performance issues with registering a number of routes with the routing engine in ASP.NET MVC 2? What I am planning on doing is registered one route per page for content pages that are not categories. In other words, for pages like this there would be one route registered for each one:
/Home/About
/Home/Contact
/Home/Dire...
I have a .aspx page with some Webmethods that I use for jQuery ajax calls.
[WebMethod]
public static string HelloWorld(string s) {
return "Hello"+ s;
}
And call this with Url: /ajax/Test.aspx/HelloWorld
I wonder if it is possible to route this method to another url like /ajax/helloworld/?
...
So far I still have the standard routing. What I tried to do is
public Foo : Controller
{
public ActionResult Index(int id)
{
return View("List", repo.GetForId(id));
}
public ActionResult Index()
{
return View("List", repo.GetAll());
}
}
The URL I entered was
localhost/Foo/Index.
I was un...
I have a primary model for my project, Place.rb with a places_controller, and I've currently got it exactly the way I want for the users end of my project. With a nested photos controller, review, etc.
I want now to create a management resource which is mostly just an alias for Places, with its own nested resources, some of them overla...
Hi
My routes are getting out of hand due to the fact that this isn't possible (correct me if I'm wrong):
map.resources :english_pages, :as => :english, :spanish_pages, :as => :spanish do |article|
Due to nested routes things are spiralling out of control (tidiness).
map.resources :english_pages, :as => :english, :member => {:manage ...
I am using ASP.Net 3.5 SP1 "System.Web.Routing" to enable URL routing in my WebForm Application. Now what i needed is to pass some parameters in QueryString eg:
http://www.mydomain.com/Search/Books/Computers?sort=author&pagesize=10
This is the route i am using:
routes.Add("BooksSearch", new Route
(
"Sear...
In my Rails application, I would like to route /product/productname1, /product/productname2, etc. to ProductController::index(). I don't want separate methods in my ProductController for each product name route.
What would my route look like?
I have
map.connect 'products/:name', :controller => 'products', :action => 'index'
But when...
Is is possible to create a recursive route in Rails?
I have an application, which allows a admin to create pages. The page model is a nested set and so each page has a parent_id hence the pages are structured in trees. The page model also uses the Friendly ID plugin to provide slugs for each page.
When a user browses the site I would l...
I've got a RESTful resource (let's say posts) that excludes the index action. When I go to /posts, ActionController::MethodNotAllowed is raised because GET requests at that URL have been excluded. That much makes sense.
The problem is that in the production environment, that URL just generates a white screen in the browser. I can see Ac...
Hi, I'm trying to implement a REST API to my website.
My problem is that the default Zend routing gets in the way. I've first tried using Zend_Rest_Route but I haven't been able to understand how I was supposed to use it correctly for "deep" routes, aka website/api/resource1/filter/resource2/id.
Using the default Zend routing, I'd need...
Is there a way to create a route like this "http://mysite/Username" ?
...
I need to check if a TCP/IP route already exists from my application and add the route if it doesn't.
Now I'm running the
route add <destination network ip address> MASK <mask> <gateway ip address>
with a Process.Start() and that's fine for me.
However, as I'm elevating the route command with a "runas" verb, I need to check first if ...
Hi Guys
Can anyone tell me what is the syntax for retreiving the actual URL for the "Default" Route?
I'd like to do something like:
string url = RouteTable.Routes["Default"].ToString();
//(even though that code is completely wrong)
so that I could have the url value of the route available to work with.
So far, I've been trying the...
Hi!
I want to identify categories in my site in url not by id, but by its name. When i'm adding category, which name contains "+" symbol - i have 404 error. This situation is on product internet server, when i'm deploying on local visual studio server - all work fine. Please, suggest me smth.
Example:
routes.MapRoute(
"Defaul...
Hi
I wondered if there's some way to do this
polymorphic_path([@page, @image])
but like this
polymorphic_path([@page, :image_id => 1])
It's for the purposed of refactoring where I'd like to throw various params into the array and where they're null, they're ignored, but otherwise they generate the relevant nested url.
Thanks in ...
Hi,
I have a URL /products/search where Products is the controller and Search is the action. This url contains a search form whose action attribute is (and should always be) /products/search eg;
<%using( Html.BeginForm( "search", "products", FormMethod.Post))
This works ok until I introduce paging in the search results. For example i...
The following code:
map.resources :users, :has_many => :items
Could be written like this in a block:
map.resources :users do |user|
user.resources :items
end
How could I write the following code in a block?
map.resources :users, :member => { :start => :post }
Also, where could I find documentation on writing routes in blocks?...