This error occurred when I tried to call Response.Redirect method from a class file. Then I tried to find the solution and I got to know that when we use the response object from an aspx page either from aspx page or it’s codebehind page, the response object is directly available because all these derived from the page object.
When we use the response object in our own class, the object is not directly available, so we got this message.
But we can use it by the following method :
Same problem happens when we tried to call a function from Response object.