Click here to Skip to main content
12,953,379 members (51,298 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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 9:19am
Updated 22-Jun-12 9: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
OriginalGriff 6,429
CHill60 3,490
Maciej Los 3,103
Jochen Arndt 1,975
ppolymorphe 1,930

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 23 Jun 2012
Copyright © CodeProject, 1999-2017
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