- Joined
- May 20, 2009
- Messages
- 1
- Reaction score
- 0
Hi, I'm from Argentina,
When entering a page (let's call it Page A), if user is not authenticated, I want to redirect him to login page with ReturnUrl to Page A. A solution could be to deny page A in web.config but can't do that because there's also a datetime condition to allow or deny unlogged users.
Here's the code in the page load of Page A:
if (pub.creacion > DateTime.Now)
{
if (User.Identity.IsAuthenticated)
{
usu.id = User.Identity.Name;
usu.recuperar();
}
else
{
Response.Redirect("../gral/login.aspx?ReturnUrl=" + CQueryString.GetEncryptedQueryString("id=" + this.SecureQueryString["i"]));
This line above has the error. I want to redirect to login page with ReturnUrl to Page A (this page)
}
}
Page A has query encription ----> CPublicacion pub = new CPublicacion(long.Parse(SecureQueryString["id"]), true );
Any ideas ??
Thanks !!
When entering a page (let's call it Page A), if user is not authenticated, I want to redirect him to login page with ReturnUrl to Page A. A solution could be to deny page A in web.config but can't do that because there's also a datetime condition to allow or deny unlogged users.
Here's the code in the page load of Page A:
if (pub.creacion > DateTime.Now)
{
if (User.Identity.IsAuthenticated)
{
usu.id = User.Identity.Name;
usu.recuperar();
}
else
{
Response.Redirect("../gral/login.aspx?ReturnUrl=" + CQueryString.GetEncryptedQueryString("id=" + this.SecureQueryString["i"]));
This line above has the error. I want to redirect to login page with ReturnUrl to Page A (this page)
}
}
Page A has query encription ----> CPublicacion pub = new CPublicacion(long.Parse(SecureQueryString["id"]), true );
Any ideas ??
Thanks !!