How do you use response.redirect in a class module?

Posted on 2005-04-16
Last Modified: 2012-06-21
I feel stupid asking this, but I've got to know. When I code "Response.Redirect" in my code behind module, it works. But if I attempt to use it in a separate class module, it doesn't work, saying "Object Not Declared." I've imported the all the proper namespaces, but no go? What's going on? I'm coding in vb. Thanks.
Question by:barnesco
    LVL 20

    Expert Comment

    First import System.Web namespace then use this syntax

    LVL 20

    Accepted Solution

    Oops.. I meant,

    HttpContext.Current.Response.Redirect( "<path>" )

    Author Comment

    I just realized that "Inherits System.Web.UI.Page" does it, too. Thanks for your quick response!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now