Design and CSS styles
Version 5.x > Design and CSS styles > Cloned LogonForm's custom code not called View modes: 
User avatar
Member
Member
Ash - 1/29/2010 5:19:25 AM
   
Cloned LogonForm's custom code not called
I have cloned the Logon form and modified the Login1_LoggedIn() methos as follows:


// Redirect user to the return url if it is within the Client specific area, or redirect to the Client specific home page
bool busing_return_url = false;
string return_url = ValidationHelper.GetString(Request.QueryString["ReturnURL"], "");
if (return_url != "")
{
// if the Redirect URL is in the Client area, then redirect to there
if (return_url.Contains("/Clients/"))
{
busing_return_url = true;
UrlHelper.Redirect(ResolveUrl(return_url));
}
}
if (!busing_return_url)
{
// check if user's starting alias path has been set
string user_starting_alias_path = CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros("{%currentuser.userstartingaliaspath%}");
if (user_starting_alias_path != "") /* use the starting alias path */
UrlHelper.Redirect(ResolveUrl("~/Clients/" + user_starting_alias_path + "/Home.aspx"));
else /* default to the News page accessible to all Clients */
UrlHelper.Redirect(ResolveUrl("~/Clients/News.aspx"));
}


The webpart has been changed on the page and I have proved the page is being loaded by adding/changing some static text. However, it appears my code is not being called because the webpart’s Default URL is always being loaded (irrespective of whether this property contains a value).

What am I missing?

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 2/6/2010 3:56:05 AM
   
RE:Cloned LogonForm's custom code not called
Hello,

I'm not sure what causes this issue. Could you please open Kentico CMS project in Visual Studio and debug your copy of web part and check if your redirection is accessed or which line of code redirects user to Default URL?

Best Regards,

Martin Dobsicek