You can create a filter that instead of redirecting to the login page return
a status code 401 and catch that using jquery and handling it the way is
more convenient of your application.

2009/8/4 Cesar Sanz <the.email.tr...@gmail.com>

>
> Hi, thanks,
>
> What can I say?? just copy and paste...
>
> I was trying with this entry in the web.config
>
>    <customErrors defaultRedirect="~/error/general.castle" mode="On">
>
>      <error statusCode="404" redirect="~/error/showerror.castle"/>
>
>    </customErrors>
>
>
>
> I created a controller:
>
>    ErrorController and views showerror.vm and general.vm, and it seems to
> work.. although don't know
>
> which one is better.
>
>
>
> Working with this, I have another question..
>
>
>
> My web-application is working with sessions.. But I make some ajax calls
> and
> the result is placed into a div (using jquery)
>
> the problem is, that when the session is expired, my application must to
> redirect the user to the login page... but..... the login page is
>
> loaded via ajax instead and shown in the div container..
>
>
>
> How can I walkaround this?? It strikes me that maybe I can check the server
> response code to see if it is redirecting to login page..
>
>
>
> But don't know how to do it, pleas help me
>
>
>
>
>
> ----- Original Message -----
> From: "John Simons" <johnsimons...@yahoo.com.au>
> To: "Castle Project Users" <castle-project-users@googlegroups.com>
> Sent: Tuesday, August 04, 2009 3:43 PM
> Subject: Re: Custom Error Page for ASP.NET
>
>
>
> Have  look at this blog:
>
> http://chadly.net/post/2009/03/10/Custom-MonorailHttpHandlerFactory-to-handle-404s-gracefully.aspx
> It should give you the answer :)
>
> On Aug 5, 6:15 am, "Cesar Sanz" <the.email.tr...@gmail.com> wrote:
> > Ok, I will take a look,
> >
> > Thanks
> >
> > ----- Original Message -----
> > From: Ricardo Lopes
> > To: castle-project-users@googlegroups.com
> > Sent: Tuesday, August 04, 2009 2:09 PM
> > Subject: Re: Custom Error Page for ASP.NET
> >
> > I created an error controller to show nice error pages (is just another
> > controller with a different layout and just do some logging).
> >
> > You should also take a look at the rescue
> > controllers.
> http://justinram.wordpress.com/2009/01/09/monorail-custom-rescue-cont...
> >
> > You wont be able to catch http 500 errors that happend before castle is
> > loaded, like when an assembly is missing or in the application/castle
> > initialization.
> >
> > 2009/8/4 Cesar Sanz <the.email.tr...@gmail.com>
> >
> > hi,
> >
> > yes, I have experimented with something like this
> >
> > <customErrors defaultRedirect="~/ErrorPages/Oops.aspx" mode="On">
> >
> > <error statusCode="404" redirect="~/ErrorPages/404.aspx"/>
> >
> > </customErrors>
> >
> > And it works, but as I use a template (which contains a menu) I want to
> > display the error using a .vm file instead of a
> > .aspx page.
> >
> > How can I do that?
> >
> > ----- Original Message -----
> >
> > From: "James Curran" <james.cur...@gmail.com>
> > To: <castle-project-users@googlegroups.com>
> >
> > Sent: Tuesday, August 04, 2009 1:43 PM
> > Subject: Re: Custom Error Page for ASP.NET
> >
> > I believe those are still controlled by the <customError> section in
> > the web.config.
> >
> > On Tue, Aug 4, 2009 at 3:04 PM, Cesar Sanz<the.email.tr...@gmail.com>
> > wrote:
> > >> What sorts of exceptions are they
> > > Well, I am still in prototype, so, when I present the project,
> sometimes
> > > it
> > > display a
> > > yellow page, for example, for a missing dll or a file not found
> > > exception,
> > > etc.
> >
> > > It is a little enbarrasing, so I want to get rid of those pages, (all
> > > the
> > > exceptions the application have are
> > > written to a log file)
> >
> > >>You can handle global exceptions via Custom 500 pages perhaps
> > > Do you mean internal errors?
> >
> > > ----- Original Message -----
> > > From: Tuna Toksoz
> > > To: castle-project-users@googlegroups.com
> > > Sent: Tuesday, August 04, 2009 12:17 PM
> > > Subject: Re: Custom Error Page for ASP.NET
> > > What sorts of exceptions are they, I mean where do they occur? In
> > > action,
> > > filter, etc?
> > > You can handle global exceptions via Custom 500 pages perhaps
> >
> > > Tuna Toksöz
> > > Eternal sunshine of the open source mind.
> >
> > >http://devlicio.us/blogs/tuna_toksoz
> > >http://tunatoksoz.com
> > >http://twitter.com/tehlike
> >
> > > On Tue, Aug 4, 2009 at 9:14 PM, the.email.tr...@gmail.com
> > > <the.email.tr...@gmail.com> wrote:
> >
> > >> yellow page showing t
> >
> > --
> > Truth,
> > James
> >
> > --
> >
> > Ricardo Lopes
>
>
> >
>


-- 

Ricardo Lopes

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to castle-project-users@googlegroups.com
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to