This project is read-only.

how to redirect to my own page when user login ?

Topics: Customizing Orchard, Writing modules, Writing themes
Nov 29, 2011 at 12:43 AM
Edited Nov 29, 2011 at 12:46 AM

I create a customized page for my login user instead of default page to display.

Additionally,  how can I add an action on the home page to link to my own mvc view ?  I want it to trigger controller action.  



Nov 29, 2011 at 1:09 AM

You don't redirect to your own page, you override the existing one.

To create an action link, that's the same as any MVC app, use Html.ActionLink, except that you need to specify the module name as the area in the option object.

Nov 29, 2011 at 1:29 AM

can you tell me how to override ?


I created a page from admin console.  that page is pure HTML.   what the way to add action link to my own content page?

I only have access to html source for that page, you know.  how to let the link to trigger my controller action.  that's what I was asking. thanks.

Nov 29, 2011 at 2:04 AM

What do you mean you only have access to html source??

Nov 29, 2011 at 3:18 AM

The page I created from Admin panel is standard page.   So I can only edit the content from the editor provided by Orchard. 

there is only a html source button for it.   so to customise this page,  what can I do to add text links or images link etc.

Issue two,  I want to be able to redirect to my new page when user login instead of going to dashboard.  the user should only view their own contents.


Nov 29, 2011 at 7:20 AM

You can't do that with a content page. What's wrong with the standard login page that you can't use it?

Nov 29, 2011 at 10:54 PM

for the special clients, I want to redirect them to their own page to perform individual tasks. 

Currently after user login,  they are redirected to the page they were coming from.   I want to customize this behavior.

BTW, In Orchard solution,  where could I control the routing behavior such as adding my own routes.  

Nov 29, 2011 at 11:09 PM

Oh then you'll want to override the route to point to your custom controller where you can redirect to what you want after authentication. Routes are added through a class implementing IRouteProvider (look for routes.cs files throughout the code for examples).