samaira samaira replied to Reena Jain

am not using form authentication because i had some issued using it, am using login view n login controls though.
I have manually dislayed "welcome username" n logout in master page, which is invisible in login page n visible in loggedIn page! below is the code used in master.cs page:
protected void Page_Load(object sender, EventArgs e)
{
string sesn = Session["EmpName"].ToString();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
Session.Clear();
Session.Abandon();
if (!IsPostBack)
{
/* datap.SelectCommand = cmd;
.
.
.
cmd.Connection = conn;
conn.Open();
DataSet dataset = new DataSet();
datap.Fill(dataset); */
if (Session["Empname"] != null)
{
string ssn = Session["EmpName"].ToString();
lblwelcome.Text = "Welcome " + ssn + " !";
LinkButton1.Text =" Log out";
}
else
{
LinkButton1.Text = "Log In";
lblwelcome.Visible = false;
LinkButton1.Visible = false;
}
}
}
protected void btnlogout_Click(object sender, EventArgs e)
{
if (Session["EmpName"] != null)
{
Response.Redirect("~/Forms/Login.aspx");
}
}
This is the code used in logged In page
protected void Page_Load(object sender, EventArgs e)
{
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddHours(-1);
Response.Expires = 0;
Response.CacheControl = "no-cache";
//Page.RegisterClientScriptBlock("<script>if(history.length>=0)history.go(+1);</script>");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
alot var Hi What are Master Pages in ASP.NET? or What is a Master Page? ASP.NET master pages allow you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you want for all of the you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page. What are the 2 important parts of a master page? The following are the 2 important parts of a master page 1. The Master Page itself 2. One or more Content Pages Can Master Pages be nested? Yes, Master Pages
Page Directive? What is the purpose of page directive in aspx page? Directive Syntax Directives are instructions used to specify settings (related to how a page should render and processed) used by the page and user control compilers when they process ASP.NET Web Forms page (.aspx) and user control (.ascx) files. These are the essential part of every ASP.NET Page or Control. Directives can be located anywhere in an .aspx or .ascx file, but the values, same as any HTML tag) that are specific to that directive. Special Note: The @ Page directive can be used only in .aspx files, and the @ Control directive can be used
this.tabControl1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); } private void tab1Button1_Click(object sender, System.EventArgs e) { / / Inserts the code that should run when the button is clicked. } void tabControl1_Selected(object e.TabPage)) { _cache.Remove(e.TabPage); } _cache.Add(e.TabPage); } } private void button1_Click(object sender, EventArgs e) { TabPage page = new TabPage("TabPage" + pageNumber.ToString()); AddControlsToTabPage(page); this.tabControl1.TabPages.Add(page); pageNumber++; this.tabControl1.SelectedTab = page; } private void AddControlsToTabPage(TabPage page) { page.Controls.Add(this.tab1CheckBox1); page.Controls.Add(this.tabCheckBox2); page.Controls.Add(this.tabCheckBox3); page
Utilities; using System.Text.RegularExpressions; using System.Net; public partial class Production_OA_Config : System.Web.UI.Page { #region Public Variables & Objects ExceptionHandler objHandlers; OAEntity _oaEntity = new OAEntity(); List<object> obj = new List string Hieght_Y = ""; public string Time = ""; / / - -- -- -- public int _Part = 0; #endregion protected void Page_Load(object sender, EventArgs e) { try { if (Session["UserId"] ! = null) { User_Id = Convert.ToInt32(Session["UserId"].ToString()); if (!IsPostBack) { / / LoadInitialSetting ScriptManager.RegisterStartupScript(this, this.GetType(), "popup message", "setconformation();setScrollerWidth();slidStart();", true); if (CadPartListpopUp ! = null) { / / ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "cadpop", "document.getElementById('" + CadPartListpopUp.ClientID + "').style.display = '';ShowBackShadow('dvbackShadow', true);", true); } } catch (ExceptionHandler ex) { ErrorHandler.SetMessage(ex.MessageDetails(), spnmessage); / / ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "popup message", "document.getElementById('" + ErrorPop.ClientID + "').style.display = '';", true); ScriptManager RegisterClientScriptBlock(this, this.GetType(), "popup message", "Message_MoveTO_popup('" + spnmessage.ClientID + "', 'spnmessage');JqueryPopupShow();", true); } catch (Exception ex) { objHandlers = new ExceptionHandler(ex, true); ErrorHandler.SetMessage(objHandlers.MessageDetails(), spnmessage); / / ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "popup message", "document.getElementById('" + ErrorPop.ClientID + "').style.display = '';", true); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "popup message", "Message_MoveTO_popup('" + spnmessage.ClientID + "', 'spnmessage');JqueryPopupShow();", true); } } private void BindActor() { / / ddlCustomer name = "sender"> < / param> / / / <param name = "e"> < / param> protected void imgbtnAddCadPro_OnClick(object sender, ImageClickEventArgs e) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "cadpop", "document.getElementById('" + CadProdListpopUp.ClientID + "').style.display = '';ShowBackShadow('dvbackShadow', true);", true); Chk_Product_Amada_CadCAM_Service