Redirection to a certain page after authentication
When using log on web part, sometimes it is required to redirect the user to some specific page.
This is possible by modifying the code of the LogonForm
web part. It is recommended to create a copy of the default web part to avoid changes after upgrading - Modifying the code of standard web parts.
Then you need to modify the code behind to look for example like this:
if (this.DefaultTargetUrl != "")
// If the user comes to the ~/SpecialPages/Logon.aspx, it will redirect him/her
//to ~/member/samplepage.aspx after successful authentication
else if (Request.Url.Query.Contains("Logon")) // Hard-coded
Response.Redirect("~/Member/SamplePage.aspx"); // Hard-coded page to redirect to
}See also: Applies to:
Kentico CMS 3.x