Click here to Skip to main content
12,396,054 members (67,291 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ADO.NET Redirection
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 22-Jun-12 9:19am
Updated 22-Jun-12 9:34am
v2

1 solution

Rate this: bad
 
good
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.
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


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