I add (on the if (HasTemplate...) )
else
{
Response.StatusCode = 404;
}
On Wed, Sep 2, 2009 at 2:29 PM, James Curran <[email protected]> wrote:
>
> Funny, I was just about to write a blog post about this. Here's what I
> use"
>
>
> [DefaultAction]
> public abstract class PlainTextController : SmartDispatcherController
> {
> public void DefaultAction()
> {
> string template = "notfound";
>
> if (HasTemplate(this.ControllerContext.Name +"/" + Action))
> {
> template = Action;
> }
>
> RenderView(template);
> }
> }
>
> [Layout("default"), Rescue("generalerror")]
> public class MySiteController : PlainTextController { }
>
>
>
> Then, you just need the .vm (or .brail etc) files in your views folder
> for the static pages. This gives you the advantage of being able to
> use layouts for those pages.
>
>
>
> On Tue, Sep 1, 2009 at 11:29 PM, JakeS<[email protected]> wrote:
> >
> > I've got a monorail site that's running with controllers mapped to
> > "*.html" pages so the URLs are http://mysite.com/controller/action.html
> >
> > Now I've been given a set of static pages that we need to put into the
> > root of the site... something like http://mysite.com/about.html.
> >
> > Is there an easy way to do this? Or do I have to create a
> > "StaticController" for these static pages with actions for each one
> > and use routing to turn /about.html into StaticController's "about"
> > action?
> > >
> >
>
>
>
> --
> Truth,
> James
>
> >
>
--
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.idcc.co.il - הכנס הקהילתי הראשון למפתחי דוטנט - בואו בהמוניכם
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---