Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1010257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:03:16+00:00 2026-05-16T09:03:16+00:00

I have this little bit of code: using System; using System.Web.Mvc; public class SecureFilter

  • 0

I have this little bit of code:

using System;
using System.Web.Mvc;

public class SecureFilter : RequireHttpsAttribute
{
    public override void OnAuthorization(AuthorizationContext filterContext)
    {
        if (null == filterContext)
        {
            throw new ArgumentNullException("filterContext");
        }

        if (null != filterContext.HttpContext && filterContext.HttpContext.Request.IsLocal)
        {
            return;
        }

        base.OnAuthorization(filterContext);
    }
}

Where I am trying to determine if the request is local or not is where I am getting the compile time exception. It gives me this error:

‘System.Web.HttpContextBase’ does not contain a definition for ‘Request’ and no extension method ‘Request’ accepting a first argument of type ‘System.Web.HttpContextBase’ could be found (are you missing a using directive or an assembly reference?)

From what I understand the Request object actually belongs to the controller, but I am not quite sure how I am supposed to create this action filter if I am not able to gain access to the object.

Any guidance here would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T09:03:17+00:00Added an answer on May 16, 2026 at 9:03 am

    This was something quirky with the project it seems. I followed Nick Riggs advice and tried a test solution and it worked just fine. So I deleted the project from my current solution and created a new one and just copied the files into it. This got it working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this little bit of code: public static void LoadSomething(Type t) {
I am trying to compile the following code: public static void RequireOrPermanentRedirect<T>(this System.Web.UI.Page page,
its a little bit hard to understand. in the header.php i have this code:
This question may seem a little bit stackoverflow-implementation specific, but I have seen a
I have a repeater of div's that look a little bit like this: <div
I have this little problem. My client wanted two distinct swf on a web
This is a little bit of a strange question, but I have a bunch
I have this little rake task: namespace :db do namespace :test do task :reset
I have this little problem, that I cannot figure out which arguments to pass
I have this little question that's been on my mind for a while now.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.