.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Cache Authenticated Page

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :ASP.Net


How to cache authenticated page?

Stephen Walther suggests not to cache authorize page (http://stephenwalther.com/blog/archive/2008/08/29/asp-net-mvc-tip-40-don-t-cache-pages-that-require-authentication.aspx) , but every page I have need the built-in Authorize() filter for easy integration. Sad

I have tested both Authorize() and the CacheFilter in the same controller and indeed I can see the other users role account . How can I have the Authorize() and the Cachefilter in the same controller then?

The Cachefilter can be found here (http://weblogs.asp.net/rashid/archive/2008/03/28/asp-net-mvc-action-filter-caching-and-compression.aspx).

Thank You,


View Complete Post

More Related Resource Links

TypePerf, Buffer Cache Hit Ratio, Page Life expectancy and some other counters....

Hello, I 've scheduled a Task on a Windows 2008 R2 Server (a Blade with 2 Processors (6 core HT) and 18 GB RAM) to check some SQL Server 2008 Performance Counters. The task runs TypePerf that checks the Counters every 15 seconds for 10 minutes. The task is scheduled every hour. The strange result is that Buffer Cache Hit Ratio, Page Life expectancy and some other Counters are ALWAYS = 0 but if I run PerfMon, Buffer Cache Hit Ratio is 100 and  Page Life expectancy >>>> 300. Any Idea? Thank youLuca Bovo MCTS - MCITP SQL Server 2005 (Database Administrator and Database Developer)

Log Cache Page size

Hello: trying to get more details about Log Cache. i am aware that Data page size is 8KB. want to know the size of page in Log Cache, as i am not able to see that inofrmation in BOL & at MSDN. Any link or pointer is highly appreciated. Thanking in advance. Thanks

How do I allow some .net pages to be used from a login page before the user is authenticated?

Ok, I have a .net homepage (viewable and useable to everyone) which is "login.aspx".  There is a header with a menu and three columns under that.  The header has a "home" button which will display a page (standings.aspx) with data from a gridview control which gets its data from an access db in a directory called Access_DB from the root level of the site. The next menu in the header is "Schedules", which uses the same db and a set of .aspx files (i.g. MondaySched.aspx, ThursdaySched.aspx, etc) to populate NFL schedules in various formats, and the last column "About" is just some html files.  All of this data is placed in an IFRAME in the middle column of the page.  The left column is where the login textboxes/submit button reside, the last column is just some html.I am using form level authentication as follows:<authentication mode="forms"><forms name="BTGAppSec" loginUrl="login.aspx" protection="All" timeout="30" path="/" /></authentication><authorization><deny users="?" /></authorization>The problem is when you go to the site and it tries to load the "standings.aspx" into the IFRAME on page load, it sees that as an unauthorized user and sends the IFRAME back to login.aspx.  So what you get is a &qu

strange Cache and GridView bug after googlebot crawls a page


I have a strange ui bug in GridView !

GridView adds <font color="#000FFF"> after a page is accessed by a Google crawler and then when the page is views from the cache created by the bot  !!!

It is happening in the HeaderText "th" and TemplateField's and HyperLinkField's

I never set the color to <font color="#000FFF"> and i have CSS class's and ForeColor with all different colors

When a user enters a page it doesn't happens and no font tag is added !!!

please help...

How to cache MVC page with sign in info?



[OutputCache (Duration=20, VaryByParam="None" )]
public ActionResult  display()

This code cache whole page.

But, my site has user infomation on top like this ASP.net. The user info "Signed as userid | Edit Profile | ..." section should be changed when user sign in/out. But rest of the page is always same and it's good to Cache.

If the above code is used, the user info on top also cached and give wrong info to user.

So, what is the best solution for this?

Any idea?

Thank you,

form inside authenticated page!




Inside authenticated page for only authenticated users can reach, i want to create a form and link it to a database, and the data will be saved in the database for this user only.


what is the code to accomplish thing?

also when i make a history page, i need the data to be showing for this user only that entered his info into the form.


should i use details view? or create text-boxes and link it to database for inserting?

How to Disable Add all authenticated users link in Add user page of Sharepoint



I want to disable the link "Add all authenticated users " appearing on "Add user" page. Is there a way to disable or remove this link from the "add user" page.

I referred a blog http://sfguyalex.blogspot.com/2008/08/all-authenticated-users-please-stand-up.html where it mentions to remove the link by editing page in 12 hive AclInv.aspx.

Before doing that, is there any way thru configuration I stop users by clicking on this link?




What happens to a page's cache when a user logs in?


When you cache a page I assume you are saving the rendered html that gets sent to the user who requested the page. What happens when the person who requests the page is logged in and their user name is displayed at the top of the page. This I assume will change the html that is rendered and thus mean the cache is rebuilt?

If so is there any point caching pages in such a scenario as I assume there will be a performance penalty rebuilding and storing the cache all the time?

I am not sure if this makes any difference but all the pages have a master page and this is where the login is displayed.



Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Using jQuery to directly call ASP.NET AJAX page methods

Here I am looking to explain how to call page methods using jQuery. Using jQuery to directly call ASP.NET AJAX page methods

Reduce ASP.NET Page size and complexity using JQuery

This is my first post on asp.net blog. ASP.NET Ajax and JQuery are two different ajax framework. In this post I will show, how we can enhance gridview using ASP.NET Ajax and JQuery. I also compare the implementation of these frameworks. In next posts i will explain more about JQuery and ASP.NET Ajax and also tell you "How to combine the power of both framework". My Future post will related to ASP.NET and related frameworks.


I have 2 web pages. First page has a textbox and a button control.

when I enter test and click on the button , system goes to the second page. And in the second page I want to access the Textbox in the first page. When I try to do this I get the following error.

"Object reference not set to an instance of an object. Following is my code :

Dim txt As New TextBox

' Find the server name on the previous page
txt = CType(Page.PreviousPage.FindControl("TextBox2"), TextBox)
If Not IsNothing(txt) Then
Response.Write("[Name Not available]")
End If

I know I could do this with session, but I want to use the Page.PreviousPage.FindControl. Any help is greatly appreciated

Unique content within master page based on conditions met


 Hi all-

I would like to present users with unique content based on certain conditions being met as they land on the home page (default.aspx).  The condition logic will be in the VB code behind Page Load event. The content will go in a content placeholder as specificed from the master page. 

However, the content change wouldn't be something small (ie making a panel or label visible or not) but rather it will be different HTML,  Divs and databound gridview content.  The HTML content will be stored in the database.

Can someone point me in the right direction for best practices on how to accomplish this?


Launch CMD File From ASPX Page


My organization uses a CMD file to install updated files for a major enterprise application. Currently, we send out an email to users with a link to the file and instructions to run it, BUT inevitably users don't update their machines until their in field and try to start the app.


We're now liking the idea of using an ASPX page to prompt the users to run the updates and to capture the fact that the updates have been run. I realize that we can't capture the success or failure of the update. But we'd like to capture the user accessed the page.


Is it possible to embed into the markup for the page a link to the file on the local intranet that the users can click on to run the file?

The user accessing the page would capture that they did just that. We'd deal with wether or not the update was actually installed or if it failed later with them directly.

Handling 404 page not found with Error page



      How do i handle 404 page not found?

Setting the default start page in godaddy hosting?


 How do you set the start page with godaddy hosting? I can see no way of doing this! You do not seem to have access to the IIS settings that allow you to change it!

Need help redirecting users to personalized page


 Hi, first timer here so be gentle.


I've been able to create a cool little website, it's up and running with users logging in and out, I created roles so my administrative team can see sensitive data that's not available to regular and anonymous users.

Now they would like me to create a page specific to each user.  For instance when user A logs in they are redirected to a page that has information that pertains to user A only (like a list of their benefits/ their remaining vacation time). This page needs to be accessible only to user A. 

I've watched a ton of the videos but have yet to see one that covers this topic, any help would be great!!!





ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend