I am building onto the example found here:
http://www.mikesdotnetting.com/Article/126/ASP.NET-MVC-Prevent-Image-Leeching-with-a-Custom-RouteHandler
What I would like to do now is have some logic that checks for certain data in session before allowing the valid image to show. Is it possible to access session data from within the custom ...
In Ruby on Rails routing (using route.rb), can it say, for any URL having the form:
www.example.com/ ... #! ...
then use controller redirect ?
This is so that in AJAX, some page can tag the #! at the end of URL so that the real content of interest is the part after the #!
...
I have the following in my routes.rb
map.diff 'posts/:id/diff/:from/:to', :controller => "posts",
:action => "diff", :conditions => { :method => :get }
And I have the following in my view file.
- form_tag(diff_path(), :method => :get) do
= text_field_tag(:from, "")
= text_field_tag(:to, "")
= hidden_field_tag...
I've put this line in my routes.db file:
map.mything '/mything', :controller => 'mything', :action => 'list'
But I get this error when I go to http://localhost:3000/mything, I get this error:
Unknown action
No action responded to index. Actions: list
Why is it trying to use index instead of list? I thought that by setting
:action ...
what's the difference between a message bus[1] and a message broker[2]
Both is middleware for applications
Both can be used to decouple various systems
Both can have a canonical data model
Both route messages and could offer other features such as data transform
As i see, the only relevent difference is the picture used to represent...
Hello.
I've written the admin area of a particular rails app and now I'm ready to set it as own section within the website.
Therefore, it will be /admin
However, I didn't want to have it as /admin within the route itself I wanted to have something less common, so I added a couple of hyphens before and after it.
So the route is /-admi...
I've split my rails app into a admin directory and a public directory.
The admin directory is within an Admin:: namespace (/admin).
When I created a controller called Forums in both the Admin:: namespace and the normal root map area, the routing seems to find the Admin::Forums controller for /forums and /admin/forums.
So /admin/forums...
HI I have a web application and I'm using asp.net routing. When I publish it with the Only files needed to run this application selected it gives me an error when I'm loading any of the page "HTTP Error 404 - File or directory not found."
but if I choose publish All files it works fine.
Do you know how to resolve this issue?
...
Hi I'm setting up admin routing in CakePHP.
This is my current route:
Router::connect('/admin/:controller/:action/*', array('admin' => true, 'prefix' => 'admin', 'controller' => 'pages', 'action' => 'display', 'home'));
It works fine, but I don't understand what the difference between 'admin' => true, and 'prefix' => 'admin' is.
Whe...
I am dealing with this code in a Web Forms scenario:
public static void RegisterRoutes(RouteCollection routes)
{
Route r = new Route("{*url}", new MyRouteHandler());
routes.Add(r);
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.gif/{*pathInfo}");
}
Firstly, can anyone tell me w...
I'm replacing an old ASP.NET webforms app with a new MVC application. However, I have an issue with users having old links to a particular page that I would like to automatically translate to the correct MVC route.
Old site: http://mysite.com/ticketsdetail.aspx?id=12345
New site: http://mysite.com/tickets/details/12345
Is there a way...
Does outputcaching VaryByParams in webforms understand route parameters? Such that if I have a route similar to "Content/{filename}/{more}" that I could do VaryByParams="filename" and have it return cached results based on filename and ignore any values in the more?
...
I can't exclude non-existing files from the routing system. I am dealing with this code in a Web Forms scenario:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.gif/{*pathInfo}");
routes.IgnoreRoute("{resource}.jpg/{*pathInfo}");
R...
I have a C# web forms ASP.NET 4.0 web application that uses Routing for URLs for some reason custom errors defined in the system.web section of my web.config is entirely ignored and it will fall back the IIS errors.
This gets entirely ignored
<system.web>
<customErrors mode="On">
<error statusCode="500" redirect="~/Error" /...
In my bootstrap file, I have a heck of a lot of routes. Is there a way to use a previous route as part of a new route?
For example, if I want to change the url structure of route 'admin', instead of changing it 30 times for all the other routes, can I just include the route 'admin' in front of everything else? Something like:
$router-...
I'm looking to do something similar to this post:
http://stackoverflow.com/questions/380221/how-to-hide-controller-name-in-url
only without any sort of ID.
The server is running IIS 6 and the pages already show up without extensions so it's not a wildcard issue.
I'm looking to hit http://website.com/action-name
I have http://website...
Im trying to figure out the best way to map simple routes into one url. Application contains of 4 models: Location, Category, Budget, Company. But each model could be mapped to single url like this. For real-world example you can check out http://sortfolio.com/
/chicago <- Location
/3k-5k <- Budget
/bars <- Category
/company-name <- Com...
hi all u great experts!
im now porting my website to .net 4. (webforms, not mvc) this website is designed to cater to many bookstores. i want each bookstore to be able to use the same site as www.SiteName.com/USAbooks or www.SiteName.com/CheapBooks or whatever the bookstores name might be. can i use the new routing feature for this?
i do...
Hi,
I have used this route in rails 2.3.5 - basically, I wanted to be able to parametrize my controller that I send to the named route.
do_action "do_action/:controller" , :action => "do_action"
what is the equivalent of this in rails3 routes?
This doesn't work:
match "do_action/:controller" , :to => ":controller#do_action", :as => ...
i have an asp.net mvc page where i show a dataset in a report. I have a filter section at the top and each filter changes the dataset from:
Controller/Action
to something like this:
Controller/Action/Field1Filter
If there is no filter selected, i put a zero in this part of the url. I keep adding more fields to filter by and now ...