[Mono-aspnet-list] Why the LogOn action does not work correct?

Daniel J. Summers daniel.summers.2415 at gmail.com
Tue Mar 1 07:56:36 EST 2011


On Tue, Mar 1, 2011 at 12:58 AM, hjf1223 <hjf1223 at gmail.com> wrote:

> Download the sample site from :
> http://files.cnblogs.com/hjf1223/Mono_MVC3.zip Mono_MVC3.zip
>
> I have try it both on Windows(Nginx+FastCGI_Server) and
> openSUSE(Apache+mod_mono), both of them have same result.
>

Using that ZIP, I got the same thing using Mono 2.10 (version 4.0.30319.1)
and xsp4.  There does seem to be something amiss there.  I tried URLs like
?returnUrl=/Home and /LogOn/Home, but they don't seem to fix it either.

Since I don't have the source, can you edit Controllers/LogOnController.cs*
and remove the second parameter (return URL) under the [HttpPost]
annotation?  That may or may not break the "you asked for this page, but you
have to be logged in; we'll redirect you to login, but send you back here
when you log in" functionality, but I'd be curious as to whether that makes
it work.  Also, check Models/LogOnModel.cs* and see if it has a ReturnURL
property; if it does, maybe you don't even need that second parameter at
all.

FWIW, I'm working on similar functionality now; what I'm doing is sticking
the return URL in the session before redirecting to the login page.  Then,
once the user logs in, if the session has a URL, they get redirected there;
otherwise, they get redirected to ~/Home.  Now that I've built Mono 2.10
(thanks for the prompting), I'll be able to see if that works or not.

* These file names are guesses, but they should be right since MVC uses
names for auto-routing.

-- 
*Daniel J. Summers*
*Owner, DJS Consulting*
E-mail <daniel.summers.2415 at gmail.com> • Website <http://djs-consulting.com>
 • Support <http://support.djs-consulting.com> • Tech
Blog<http://techblog.djs-consulting.com>

GEEKCODE 3.12 GCS/IT d s-:+ a C++ P--- L++ E--- W++ N++ o? K- w !O M--
V PS+ PE++ Y? PGP- t+ 5? X+ R* tv b+ DI++ D+ G- e<++ h---- r+++ y++++
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20110301/8e786706/attachment.html 


More information about the Mono-aspnet-list mailing list