Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom user login?Custom user login?
Previous
 
Next
New Post
12/4/2006 5:56 PM
 
Hi,
I am trying to login a user on a webform in one of my custom modules. I do it this way:

System.Web.Security.FormsAuthentication.SetAuthCookie(userName, false);

Actually the user is successfully logged in but only when the page is reloaded without a postback.

How can I achieve that the usercontrol of DNN shows that I am logged in correctly? It seems that this DNN feature checks for Page.IsPostback ...

Thank You very much!
 
New Post
12/8/2006 4:00 PM
 

Gotta be sneaky see... I couldn't figure out how to do it during the login myself, so I "refreshed" the page.  See below:

private void UserAuthorized(UserInfo objUser, bool canProceed)

{

UserId = objUser.UserID;

if ((!(objUser.Profile == null)) && (!(objUser.Profile.PreferredLocale == null)))

{

Localization.SetLanguage(objUser.Profile.PreferredLocale);

}

else

{

Localization.SetLanguage(PortalSettings.DefaultLanguage);

}

UserController.UserLogin(PortalId, objUser, PortalSettings.PortalName, _ipAddress, false);

try

{

int seconds = 0;

string url = string.Empty;

string port = Request.Url.IsDefaultPort ? string.Empty : ":" + Request.Url.Port.ToString();

if (_hasRedirectUrl)

{

if (RedirectURL.IndexOf("http") == -1)

url = "http://" + Request.Url.Host + port + RedirectURL;

else

url = RedirectURL;

}

else

{

url = "http://" + Request.Url.Host + port + Request.Url.Segments[0] + Request.Url.Segments[1];

}

Response.AppendHeader("Refresh", seconds.ToString() + "; URL=" + url); // give them a second or so to see the message, then redirect

}

catch (Exception ex)

{

}

}


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom user login?Custom user login?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out