AI OnAI Off
You should be able to add additional controllers that are ignored by CMS. For instance in your global.asax.cs:
protected override void RegisterRoutes(RouteCollection routes)
{
base.RegisterRoutes(routes);
routes.MapRoute("AdditionalDiagnosticRoutes",
"diag/{controller}/{action}/{param}",
new { action = "Index", param = RouteParameter.Optional });
}
I added some additional diagnostic controllers that are not part of the CMS page/block controllers.
And controller itself:
public class VersionController : Controller
{
[Authorize(Roles = "CmsAdmins")]
public ContentResult Index(string assemblyName)
{
var fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
var version = fvi.FileVersion;
return new ContentResult { Content = "Current version: " + version };
}
}
You would need to prefix Html.ActionLink to point to your controller's url.
In an article page I have a link to an author and I want to display information about that author when you click the link.
I don't have any "Author"-page for every author, instead I can access information about that author from a database.
Is it possible somehow to use @Html.ActionLink("Phil Smith", "Author", "SomeController", new {authorId=1}, null} and have a view for that action? Any suggestions?