0
голосов
2ответов
174 просмотров

ASP.NET MVC Action links in own class

I need generate action links outside controllers. I can use Html.Action in Views, Url.Action in Controllers. That's fine but... I have my own class where I want generate HTML code for site menu, which is used in site.master. But how can I generate action links in my own class? Possible solution...

3
голосов
2ответов
3869 просмотров

MVC: "The incoming request does not match any route." - with a default request

I am getting this error only SOMETIMES (apparently randomly, though I know there's really no such thing in computers). I'm working on an MVC (release 1) site in VS 2008. The machine is running Windows 7 with IIS 7, but this instance is running under the Webserver built into VS (Cassini?). When I...

0
голосов
1ответов
111 просмотров

How do I route common named controllers by subdomain in rails

I am trying to figure out how to successfully use the same controller name in the URL, but route different controllers. Dependant on the existence of a subdomain. Example. http://www.mysite.com/pages/1 Routes to the SitePages Controller http://anyothersubdomain.mysite.com/pages/1 Routes to th...

0
голосов
3ответов
141 просмотров

URL routing, from domain.com/dir/ to otherDomain.com?

If I have a website at myFirstDomain.com/dir/, is it possible to get mySecondDomain.com to point to myFirstDomain.com/dir/ so that when users browse at the directed site, they only see mySecondDomain.com/potentialSubDirFromMyFirstDomain/ or how does it work?

3
голосов
5ответов
244 просмотров

The R in CRUD - where's the line between feature and disclosure vulnerability?

We all know how hip it is to make our Ajax calls using address routing and HTTP-Get with parameters in the URL because the client side can cache those calls and thus server load is reduced, but where do you guys think the line is between "a neat way to address resources" and "disclosure vulnerabi...

0
голосов
1ответов
507 просмотров

.net mvc custom types in urls

I'm building an asp.net mvc app that uses the default url route «/{controller}/{action}/{id}» My problem is with the last item in this route, the id. The mvc framework automatically casts whatever in put in the id to the type of the parameter declared in the action. example: url: /mycontroller...

4
голосов
3ответов
776 просмотров

Django: runtime url configuration

If there is a painless way of runtime urlconf modifications? e.g. based on database records? Bruteforce soluttion: r('^(.*)/', handmade_router_function) is too brutal for me :) Thanks in advance! UPD: I understand that i can directly modify urlpatterns from my code, but it is requires a lot...

2
голосов
4ответов
844 просмотров

What is the best RESTful way to pass string collections as parameters?

I've got a rails application with RESTful-ish URLs where I need to pass in a collection of strings (tags), and I don't want to use the query string. Currently I'm using a route similar to /controller/tagged/:tags/foo/:foo/bar/:bar.:format This requires the 'tags' to be encoded which is a pain a...

4
голосов
3ответов
5231 просмотров

Zend framework: Removing default routes

I'm using Zend FW 1.9.2, want to disable the default routes and supply my own. I really dislike the default /:controller/:action routing. The idea is to inject routes at init, and when the request cannot be routed to one of the injected routes it should be forwarded to the error controller. (by ...

3
голосов
3ответов
3306 просмотров

How to Implement URL Routing with PHP + IIS?

I wrote a content switcher script that uses dynamic URLs to pass parameters indicating what data is to be sent. For example to view the about page you would type: http://www.example.com/?page=about The issue is that this is not user friendly especially in my case where users will not necessaril...

30
голосов
6ответов
26106 просмотров

Add a trailing slash at the end of each url?

I have a little problem here. I need to add a trailing slash at the end of each url in the site I'm working on. I defined all the links inside the site to have a trailing slash like so: <a href="/register/">Register</a> While this works fine there's still one tiny issue: it's wit...

2
голосов
1ответов
342 просмотров

How can I ensure my website always opens as www.mysite.com and not mysite.com - this messed up my Google OpenID logins?

my website has a log in by open id feature. When a user logs in for the first time using his/ her openid they are redirected to a create account page. I noticed just recently that one user when logged in using her google account created an account for the first time. However when she tried to log...

0
голосов
2ответов
554 просмотров

url routing doesn't work for root folder

I've implemented url routing under asp.net 3.5 with the following code: public IHttpHandler GetHttpHandler(RequestContext requestContext) { string virtualPath = requestContext.RouteData.Values["page"].ToString(); //if virtualpath doesn't end in aspx, then it's ju...

0
голосов
1ответов
411 просмотров

url routing doesn't work when publishing to another server

I've implemented url routing with the following rule: string virtualPath = "~/" + requestContext.RouteData.Values["page"].ToString(); //if virtualpath doesn't end in aspx, then it's just a directory path loading //default.aspx by default. if (!virtualPath.EndsWith(".aspx") &...

3
голосов
3ответов
1596 просмотров

ASP.NET MVC: Restricting access using url

The URL for the administration section of my website always starts with Admin/. Is it possible in ASP.NET MVC to restrict access to users by using this part of the URL? Obviously I would keep the [Authorize(Roles = "Administrator")] on appropriate controllers and actions but I wonder if it would...

2
голосов
1ответов
1280 просмотров

How to show a custom 404 page in ASP.NET-MVC?

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 && ((HttpExc...

0
голосов
3ответов
1405 просмотров

Using SEO friendly URLs in ASP.NET

I am in a situation where I want to restructure my site's urls. That is I have a page that lists the article names (with each article name as a link). As shown below: ARTICLE1 ARTICLE2 ARTICLE3 Now if I click on an article I want the url to be as follows: www.domain.com/Artic...

0
голосов
1ответов
140 просмотров

Form submission with errors displays form + errors at a different URL from the original form

I'm working on a relatively simple website with (currently) a single resource. I have a form at GET /maps/new that submits data for a new Map to POST /maps, which redirects to GET /maps/:id after completion. The problem here is that if validation fails, it renders the new-map form, so the URL is ...

4
голосов
5ответов
3093 просмотров

Determine Final Destination of a Shortened URL in PHP?

How can I do this in PHP? e.g. bit.ly/f00b4r ==> http://www.google.com/search?q=cute+kittens In Java, the solution is this: You should issue a HEAD request to the url using a HttpWebRequest instance. In the returned HttpWebResponse, check the ResponseUri. Just make sure the ...

0
голосов
2ответов
219 просмотров

Dealing with dynamic urls

Let's say my main controller 'hotels' has a pattern for the url, such as: /hotels/colorado/aspen/hotel-name/ How should I program my controller ( keep in mind I'm still learning MVC ) to handle this variable? I know that I have to probably check if anything after /hotels/ is set, otherwise sho...

7
голосов
2ответов
8750 просмотров

How to Implement URL Routing in PHP

How to implement URL Routing in PHP.

3
голосов
5ответов
2293 просмотров

URL Rewriting with UrlRewriter.Net, ASP.NET MVC Routing or What Do You Recommend?

I'm just wondering, if you are creating a new ASP.NET web forms app in ASP.NET 3.5, which would you recommend for URL rewriting? UrlRewriter.NET or ASP.NET MVC Routing. I've used UrlRewriter.NET before and was pretty happy with it. Opinions anyone?

0
голосов
1ответов
64 просмотров

Configure UrlReplacer to only work for specific IP addresses

I'm using a utility called UrlReplacer to enable the configuration of friendly Urls for a website I'm working on. The website is developed in Asp.Net 3.5 and uses Immediacy CMS. We need to allow the client to manage their own friendly URLs. Is there any way that UrlReplacer can be set up so tha...

5
голосов
6ответов
2984 просмотров

Is there a way to maintain IsAjaxRequest() across RedirectToAction?

If you don't want any context or an example of why I need this, then skip to The question(s) at the bottom! In a bid to keep things tidy I initially built my application without JavaScript. I am now attempting to add a layer of unobtrusive JavaScript on the top of it. In the spirit of MVC I too...

1
голосов
4ответов
548 просмотров

Shortening URL params with MVC routing

I have a url along the lines of this: example.com/profile/publicview?profileKey=5 and I want to shorten it to this with routing example.com/profile/5 How do I do this? This is my attempt: routes.MapRoute( "Profile", "Profile/{profileKey}", new { controller = "Profile", acti...

0
голосов
1ответов
1856 просмотров

asp.net 3.5 url rewriting / routing for multilingual websites

I'd like to implement the asp.net 3.5 url routing functionality to take in links like www.mysite.com/fr/blah/page1.aspx www.mysite.com/en/blah/page1.aspx and redirect them to the same page. I've read through and tried the approach in the following tutorial: http://aspnet.4guysfromrolla.com/artic...

1
голосов
2ответов
293 просмотров

How to have a domain redirect to a subdirectory?

Using only DNS, how can I have http://www.example.com/ either redirect or resolve to http://www.anotherdomain.com/example ? UPDATE: Since it's been mentioned below that DNS cannot be used, what's the next best alternative (minimize load on server and provides the fastest redirect experience for...

0
голосов
1ответов
113 просмотров

URL Mapping help needed

I Have url like "http://www.mysite.com/aspx/downloaddoc.aspx?J01001" I want this to be easily accesible by typing out: "http://www.mysite.com/Whitepapers/J01001" What would be the best way to achieve this? Thanks in Advance Shashi.

4
голосов
1ответов
289 просмотров

What's the difference between example.com/controller and example.com/controller/ in Rails?

I have a PostsController, not essential to the example but will help when I paste snippets, and I'm using current_page? to, as the name implies, figure out what page is being displayed. I'm getting what seem like weird results. current_page? will return different answers if I go to /posts vs. /p...

1
голосов
2ответов
267 просмотров

URL Constraint for numeric IDs

I am trying to create some URL constraints for controllers to prevent null reference exceptions. For example /folder/edit/3 should be okay /folder/edit/asdf shouldn't be okay Instead of adding a Regex on every action method I want to use URL constraints for that. The Problem I am facing righ...