protected void btnsubmit_Click(object sender, EventArgs e) { try { dslogin = loginDA.Fetchusernamepassword(txtusername.Text, txtpassword.Text); if (dslogin != null && dslogin.Tables[0].Rows.Count > 0) { lblmessage.InnerHtml = "You are Login Successfully."; Session["UserID"] = dslogin.Tables[0].Rows[0]["USER_ID"].ToString(); txtpassword.Text = ""; txtusername.Text = ""; txtdbapassword.Text = ""; //HtmlAnchor mylink = (HtmlAnchor)Page.Master.FindControl("anchorviewratings"); //mylink.Visible = false; //HtmlAnchor mylink = (HtmlAnchor)this.Master.FindControl("anchorviewratings"); //mylink.Visible = false; Page.Response.Redirect("~/Welcome.aspx"); } else { lblmessage.InnerHtml = "Invalid Userid or Password. Please try again"; Session["UserID"] = null; txtpassword.Text = ""; txtusername.Text = ""; txtdbapassword.Text = ""; } } catch (Exception ex) { lblmessage.InnerHtml = "Invalid Userid or Password. Please try again"; } }