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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:41:54+00:00 2026-05-11T20:41:54+00:00

Is there a built-in asp.net way to conditionally serve pages, for example I want

  • 0

Is there a built-in asp.net way to conditionally serve pages, for example I want the following logic:

If there is a session data I generate
a page, if there is no session data I
serve the cached page.

I am only interested in knowing about a built-in asp.net mechanism for this. If it does not exist I am probably going to simply cache my page manually and decide whether to serve it or not for each request, based on the session data availability.

  • 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-11T20:41:54+00:00Added an answer on May 11, 2026 at 8:41 pm

    I don’t think there is built-in support (like varyByParam) for generating fresh output for users with Session Data.

    As you suggest, I would recommend manually caching the pages. I would probably determine the user’s Session state in the PreRequestHandlerExecute event handler in the Global.asax and then maybe set:

    HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to work out if there's a built in way in ASP.NET MVC
Is there a built in or a proper way to handle errors in asp.net
Is there a built-in asp.net method for checking the virtualness of a path? The
Using Castle.Windsor in ASP.NET MVC (3.0) is there any way I can appropriately handle
Is there an easy way to store user settings in an asp.net mvc app?
I've built an ASP.NET web app to view data from the Windows Event Log
I am doing web development in ASP.NET. Is there some way to load different
I have a website built using Asp.net and LinqToSql for Data Access. In a
Is there a built-in predicate or a easy way to remove from the knowledge
Is there a built-in way to ensure the endianness of multi-byte types in C++

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.