Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Response is not available in this context in asp.net

$
0
0
I want to redirect to Home.aspx page but I am getting this error message:"System.Web.HttpException: Response is not available in this context" in the line of Response.Redirect("Home.aspx"); Any idea on solving this?

if ((strbuffer[11].ToString() == strCard1[11]))
    {
        UserID = "0000";
        Send_Beep();
        System.Diagnostics.Debug.WriteLine(("UserId: " + UserID));
        comRFID.Close();
        Response.Redirect("Home.aspx");//Server.Execute("Home.aspx");//HttpContext.Current.Response.Redirect("Home.aspx");//Server.Transfer("Home.aspx", true);
    }else
    {
        Response.Write("<script>alert('Card Undefined, Please Register Your Card.');</script>");
    }

Viewing all articles
Browse latest Browse all 3938

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>