Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a bit of trouble getting a surface controller to fire correctly.
public class SocialShareSurfaceController : Umbraco.Web.Mvc.SurfaceController
public ActionResult Index()
return Content("hello world");
I'm trying to get to the controller via this URL:
But I am getting 404 error..... If I then move this file to the App_Code folder go to the same URL I get this error
A route named 'umbraco-surface-SocialShareSurface' is already in the route collection. Route names must be unique.
Parameter name: name
The route will be http://website.local/umbraco/surface/SocialShareSurface/Index/
You don't need to put the word "Surface" in the controllername though, just make sure it ends with Controller, so you can rename to SocialShareController and then your controller will work.
As for the second problem: if you have a dll with this class name and ALSO an App_Code file with the same class name then they will conflict which is why it's telling you route names need to be unique.
Thank you, thank you thank you, I didn't notice the extra surface bit on the end....working now.
The app_code thing...still not sure though, even if I rename it to something random it still gives the same error....
any way thanks - I wish I worked in your office.... I would rape your brain! :-)
Hey, Ayo :) I just wanted to let you know that I know you don't mean anything bad with the phrase, and it's basically a #h5yr, but I'd personally appreciate it if you'd be careful saying things like "rape your brain" in the future.
They can really make me, other women, and a lot of people in general really uncomfortable.
Glad your routing problem got fixed, tho! And thanks for considering my words :)
Fellow Umbraco Practitioners....
Sorry Sorry Sorry Sorry....from the bottom of my heart. Typed without thinking, didn't mean anything by it, little bit over excited about surface controllers.
@Janae - I accept your comments, without reservation, i didn't mean to upset you in any way.
Ayo, I totally understand how it is to get excited in the moment of solving a problem. I'm like that ALL the time :D No worries and thank you so much for being so positive in your response #h5yr
Bravo to both Janae and Ayo - thank you both <3
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted