Click here to Skip to main content
11,927,711 members (45,859 online)
Rate this:
Please Sign up or sign in to vote.
See more: ADO.NET Redirection

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 22-Jun-12 10:19am
Edited 22-Jun-12 10:34am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 23 Jun 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100