using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Security; using System.Security.Principal; public partial class Tournament_Organizer : System.Web.UI.MasterPage { PublicMethods clsPublicMethods = new PublicMethods(); EMUPDataContext dbEmup = new EMUPDataContext(); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //if (Context.User.Identity.IsAuthenticated == false) //{ // HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(string.Empty), null); // FormsAuthentication.SignOut(); // Session.Abandon(); // Response.Redirect("Sign-In.aspx"); //} //else //{ // LoginName loginName = HeadLoginView.FindControl("HeadLoginName") as LoginName; // loginName.FormatString = clsPublicMethods.GetOrgName(Context.User.Identity.Name.ToString()); //} if (Context.User.Identity.IsAuthenticated == false) { HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(string.Empty), null); FormsAuthentication.SignOut(); Session.Abandon(); Response.Redirect("Sign-In.aspx"); } else if (Convert.ToString(Session["Role"]) != "Organizer") { HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(string.Empty), null); FormsAuthentication.SignOut(); Session.Abandon(); Response.Redirect("Sign-In.aspx"); } else { LoginName loginName = HeadLoginView.FindControl("HeadLoginName") as LoginName; loginName.FormatString = clsPublicMethods.GetUserName(Context.User.Identity.Name.ToString()); } } } protected void ddlTournament_SelectedIndexChanged(object sender, EventArgs e) { } protected void btnSearch_Click(object sender, EventArgs e) { Response.Redirect("Default.aspx?Content=" + txtSearch.Text + "&Location=" + txtAddress.Text); } }