Skip to content

Instantly share code, notes, and snippets.

@thoolihan
Last active January 4, 2016 20:39
Show Gist options
  • Save thoolihan/8675592 to your computer and use it in GitHub Desktop.
Save thoolihan/8675592 to your computer and use it in GitHub Desktop.
#ASPNET Fix
public partial class AdminHomePage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) //note removal of !
{
try
{
Login sourcePage = Context.PreviousHandler as Login;
Label1.Text = sourcePage.Property1;
} catch(Exception ex) {
Lable1.Text = "Redirected from a page that wasn't Login";
}
}
}
}
@thoolihan
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment