I am using Respose.Write on Page_Unload event, then I get the error
Response is not available in this context.
May I know why we can’t use?
protected void Page_Unload(object sender, System.EventArgs e)
{
Response.Write(" hi ");
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That is because the
Unloadevent is triggered after the page has been rendered. The page is already complete and on the way to the browser, there is no longer a response stream that you can write to.