Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

MVC Routing

Vote:
 

I am having issue creating a custom route which is not using CMS content, for example I want to use for javascript on the client side

 

I have add a standard MVC controller

 

public class mytestController : Controller
{
//
// GET: /mytest/

public ActionResult Index()
{
return View();
}

}

 

Added a entry into Global.asax.cs to test

 

protected override void RegisterRoutes(RouteCollection routes)
{

routes.MapRoute(
"mytestRoute", // Route name
"mytest/{action}", // URL with parameters
new { controller = "mytest", action = "Index" });


base.RegisterRoutes(routes);
}

 

I have not created a view as I want my breakpoint to hit the controller index to check it works, my project is based on the Alloy demo site.

I am using EPiServer 7 release, Windows 7 on IIS7.5 - .Net4 Intregrated App pool

 

#64124
Dec 11, 2012 11:03
Vote:
 

This seems to be working now I have registerd ASP.Net 4 in IIS again

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir

I now have folder in solution and controller works as expected.

aspnet_client\system_web\system_web

#64144
Dec 11, 2012 13:40
Vote:
 

I've run into the same thing but I can't get this work at all. 404's every time I try to render the page with additional parameters.

#65392
Jan 28, 2013 23:29
Vote:
 

Check the Reference to ‘System.Web.MVC’ is V4.0.30319

 

Also these MVC Templates just released should also help

http://world.episerver.com/Articles/Items/ASPNET-MVC-Templates-for-EPiServer-7-CMS/

http://world.episerver.com/Download/Items/EPiServer-CMS/EPiServer-7---CMS/EPiServer-7-MVC-Templates/

 

 

 

 

#65397
Jan 29, 2013 9:58
Vote:
 

Got them, but I can't get them to load. CMS comes up but I can't create a page. Throws a contentLink is null error.

#65429
Jan 29, 2013 17:58
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.