public static string GetRedirectUrl (string userName, bool createPersistentCookie)
{
if (userName == null)
return null;
Initialize ();
HttpRequest request = HttpContext.Current.Request;
string returnUrl = ReturnUrl;
if (returnUrl != null)
return returnUrl;
returnUrl = request.ApplicationPath;
string apppath = request.PhysicalApplicationPath;
bool found = false;
foreach (string indexFile in indexFiles) {
string filePath = Path.Combine (apppath, indexFile);
if (File.Exists (filePath)) {
returnUrl = UrlUtils.Combine (returnUrl, indexFile);
found = true;
break;
}
}
if (!found)
returnUrl = UrlUtils.Combine (returnUrl, "index.aspx");
return returnUrl;
}