0

I have a strange problem for asp link button post back in localhost only.But it is working good in production. When ever i click that button i get following error in java-script console. enter image description here

This my button aspx code :

     <li role="presentation">
   <asp:LinkButton ID="lnkLogout" runat="server" OnClick="lnkLogout_Click"><i class="icon md-power" aria-hidden="true"></i>Logout</asp:LinkButton>
    </li>

This is codebehind :

protected void lnkLogout_Click(object sender, EventArgs e)
        {
            try
            {
                FormsAuthentication.SignOut();
                Session.Abandon();
                Response.Cookies.Remove("PageProfileID");
                Response.Cookies.Remove("Identity");
                Response.Cookies["CookieUniqueLink"].Expires = DateTime.Now.AddDays(-1);
                Response.Cookies["CookieUserid"].Expires = DateTime.Now.AddDays(-1);
                Response.Redirect("default.aspx");
            }
            catch (Exception ex)
            {
                Response.Redirect("default.aspx");
            }
        }

Please help me out.

  • Fix that error and the LinkButton will work again. They work with javascript to trigger a PostBack. – VDWWD Nov 16 '17 at 08:51
  • How can i fix that error @VDWWD? – Sourav Mukherjee Nov 16 '17 at 10:35
  • I have no idea. The error could be anywhere in your scripts/aspx pages. Try to find the differences between test and production and start there. You gonna have to debug step by step. – VDWWD Nov 16 '17 at 10:38

0 Answers0