Asp Link button post back works on production but not in localhost

233 Views Asked by At

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.

0

There are 0 best solutions below