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 8744181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:48:17+00:00 2026-06-13T11:48:17+00:00

Basically a web app that we distribute to clients, one of whom will be

  • 0

Basically a web app that we distribute to clients, one of whom will be trialling it so I need to be able to switch it off at a certain point. Don’t want to put the end date in the web.config in case they work out they can change it, I was thinking of putting something in the global.asax with a hard coded date, but then I’m not sure how I can ‘turn off’ the app. I was thinking of checking the date in the Authenticate Request part and simply redirecting to a page that says your trial is finished (or something similar), but is there a better way?

  • 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-06-13T11:48:17+00:00Added an answer on June 13, 2026 at 11:48 am

    You can do that on global.asax as:

    protected void Application_BeginRequest(Object sender, EventArgs e)
    {
       if(DateTime.UtcNow > cTheTimeLimitDate)
       {
            HttpContext.Current.Response.TrySkipIisCustomErrors = true;
            HttpContext.Current.Response.Write("...message to show...");
            HttpContext.Current.Response.StatusCode = 403;
            HttpContext.Current.Response.End();
            return ;    
       }    
    }
    

    this is safer than place it on web.config, but nothing is safe enough. Its even better there to redirect them to a page, or not show them a message, or what ever you think.

    For make redirect to a page you also need to check if the call if for a page, and the code will be as:

    protected void Application_BeginRequest(Object sender, EventArgs e)
    {
       string cTheFile = HttpContext.Current.Request.Path;
       string sExtentionOfThisFile = System.IO.Path.GetExtension(cTheFile);
       if (sExtentionOfThisFile.Equals(".aspx", StringComparison.InvariantCultureIgnoreCase))
       {
         // and here is the time limit.
         if(DateTime.UtcNow > cTheTimeLimitDate)
         {
            // make here the redirect
            HttpContext.Current.Response.End();
            return ;    
        }    
      }
    }
    

    To makes it even harder, you can make a custom BasePage that all page come from it (and not from System.Web.UI.Page) and you place there the limit on the render of the page – or show a message on top of every page render, that the time is ends.

    public abstract class BasePage : System.Web.UI.Page
    {
        protected override void Render(System.Web.UI.HtmlTextWriter writer)        
        {
            if(DateTime.UtcNow > cTheTimeLimitDate)
            {
                System.IO.StringWriter stringWriter = new System.IO.StringWriter();
    
                HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
    
                // render page inside the buffer
                base.Render(htmlWriter);
    
                string html = stringWriter.ToString();
    
                writer.Write("<h1>This evaluation is expired</h1><br><br>" + html);         
            }
            else
            {
                base.Render(writer);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a web filter app that will intercept an incoming website(one
I'm busy working on a web app that basically has 5 pages that one
Basically my app is interacting with a web service that sends back a weird
I am writing a jquery web-app that basically opens a div window based on
I have a Rails project that is basically a simple web app for a
Basically I have a web app that I'm building on top of an existing
Let's say I am building an web app that is connecting and basically parsing
I need to develop a web app that allows companies to forecast financials. the
We have an app that basically parsers some web pages. The thing is the
We have a web app that is being developed. It will be used on

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.