How to login programtically

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/28/2009 12:25:44 PM
Gravatar
Total Posts 17

How to login programatically

Dear All,

Can anyone tell me please how can I programatically login a user into website. I want to create my own login page where some other certain validations are required before login attempt. 


Regards,
Imran

8/4/2009 5:45:02 AM
Gravatar
Total Posts 15
kamran

Re: How to login programtically

Modfiy the web/secure/login.aspx page add extra field you want and save on click event there is control web/control/login.ascx modify it. It has event hander of loging and loged which you can modify

8/4/2009 6:58:50 AM
Gravatar
Total Posts 18439

Re: How to login programtically

I recommend you never modify the mojoportal code directly. You can create a custom login page in a separate project and use a post build event to copy it up to the main web project overwriting the existing one. Do not modify the Web/Controls/SiteLogin.cs. As soon as you start modifying the mojoportal code you are making a fork and that makes it impossible to upgrade to new versions of mojoPortal without losing your changes. There will be bugs fixed, there will be new features you want, do not think its unimportant to be able to upgrade, it will come back to bite you.

As far as how to programatically login a user, do some searching and reading on asp.net forms authentication, there are 2 ways to set the authentication cookie  FormsAuthentication.SetAuthCookie and FormsAuthentication.RedirectFromLogin

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.