Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

Is it not possible to use the "Response.Redirect" or the "Server.Transfer" method within a .vb class file?

For an example I am using VS 2010 and I am trying to redirect the user to another asp form if he or she has a canceled account.

When writing the code in a .vb class file the "Response" method is recognized by the class file, but the intellisence does not recognize ".Redirect". I see a message telling me that "reference to non-shared member requires an object reference".

Is there a solution to redirect the user to a different page?
Posted
Updated 22-Jun-12 9:34am
v2

1 solution

The compiler sees the Response class not the Response property of the page.

You could try to pass the page to your class. This will allow you to access 'thePage.Response'.

Alternatively HttpContext.Current.Response might work.
 
Share this answer
 
Comments
Manas Bhardwaj 23-Jun-12 17:31pm    
correct +5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900