problem with cache

hi

asp.net 3.5

I added this markup to default.aspx:
<%@ OutputCache Duration="3600" VaryByParam="none" %>

Then when I try to login and click the submit button nothing happens. I'm 
not logged in.
Now when I click on the other pages on the site (e.g navigate to other pages 
than default.aspx), on those pages
I'm logged in. Going back to default.aspx and I'm loggout...

Think this has something to do with pages was cached for an hour and asp.net 
is just showing the cached version. I hope there are some parameters or 
somehting I need to specify to solve it..

any ideas? 


0
Jeff
3/12/2010 4:44:25 PM
dotnet.framework.aspnet 1425 articles. 0 followers. Follow

3 Replies
790 Views

Similar Articles

[PageSpeed] 34



"Jeff" <it_consultant1@hotmail.com.NOSPAM> wrote in message 
news:uf8$DNgwKHA.1692@TK2MSFTNGP04.phx.gbl...
> hi
>
> asp.net 3.5
>
> I added this markup to default.aspx:
> <%@ OutputCache Duration="3600" VaryByParam="none" %>
>
> Then when I try to login and click the submit button nothing happens. I'm 
> not logged in.
> Now when I click on the other pages on the site (e.g navigate to other 
> pages than default.aspx), on those pages
> I'm logged in. Going back to default.aspx and I'm loggout...
>
> Think this has something to do with pages was cached for an hour and 
> asp.net is just showing the cached version. I hope there are some 
> parameters or somehting I need to specify to solve it..

Don't cache a page with vary by none if it has different states. You can 
vary it by custom and set it for role or user or something, but don't vary 
by nothing.

-- 
Peace and Grace,
Greg

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

************************************************
|    Think outside the box!                        |
************************************************ 

0
Gregory
3/13/2010 2:34:18 AM
What type of authentication provider do you use ? ASP NET Membership 
Provider ?

-- Ananth Ramasamy Meenachi  www.msarm.com


"Jeff" <it_consultant1@hotmail.com.NOSPAM> wrote in message 
news:uf8$DNgwKHA.1692@TK2MSFTNGP04.phx.gbl...
> hi
>
> asp.net 3.5
>
> I added this markup to default.aspx:
> <%@ OutputCache Duration="3600" VaryByParam="none" %>
>
> Then when I try to login and click the submit button nothing happens. I'm 
> not logged in.
> Now when I click on the other pages on the site (e.g navigate to other 
> pages than default.aspx), on those pages
> I'm logged in. Going back to default.aspx and I'm loggout...
>
> Think this has something to do with pages was cached for an hour and 
> asp.net is just showing the cached version. I hope there are some 
> parameters or somehting I need to specify to solve it..
>
> any ideas?
>
> 
0
Ananth
3/13/2010 4:22:15 AM
I think I've managed to solve it using varybycustom.

Here is a method I had to add to Global.asax:
public override string GetVaryByCustomString(HttpContext context, string 
custom)
{
    // This check ensures that if a user's authentication state changes,
    // the page is not cached.
    if (custom == "Login")
        return User.Identity.IsAuthenticated.ToString();

    return base.GetVaryByCustomString(context, custom);
}

in default.aspx I updated the tag to:
<%@ OutputCache Duration="3600" VaryByParam="none" VaryByCustom="Login" %>

It seams to be working ok, haven't tested it so much but the problem I had 
is gone.



"Gregory A. Beamer" <NoSpamMgbworld@comcast.netNoSpamM> wrote in message 
news:A95D1574-93AC-43E8-95CD-64876B0CE2DC@microsoft.com...
>
>
>
> "Jeff" <it_consultant1@hotmail.com.NOSPAM> wrote in message 
> news:uf8$DNgwKHA.1692@TK2MSFTNGP04.phx.gbl...
>> hi
>>
>> asp.net 3.5
>>
>> I added this markup to default.aspx:
>> <%@ OutputCache Duration="3600" VaryByParam="none" %>
>>
>> Then when I try to login and click the submit button nothing happens. I'm 
>> not logged in.
>> Now when I click on the other pages on the site (e.g navigate to other 
>> pages than default.aspx), on those pages
>> I'm logged in. Going back to default.aspx and I'm loggout...
>>
>> Think this has something to do with pages was cached for an hour and 
>> asp.net is just showing the cached version. I hope there are some 
>> parameters or somehting I need to specify to solve it..
>
> Don't cache a page with vary by none if it has different states. You can 
> vary it by custom and set it for role or user or something, but don't vary 
> by nothing.
>
> -- 
> Peace and Grace,
> Greg
>
> Twitter: @gbworld
> Blog: http://gregorybeamer.spaces.live.com
>
> ************************************************
> |    Think outside the box!                        |
> ************************************************ 


0
Jeff
3/13/2010 8:47:53 AM
Reply:

Similar Artilces:

Outlook or Windows Mobile 6 problem???
I recently got a Samsung Blackjack II Windows Mobile device, which I like way more than the Palm Treo 650 it replaced. There is one problem, however, which I describe below. I'm posting this message in this group because Samsung Level III support claims the problem is caused by outlook data corruption, not a bug in WM 6. I also posted a description of this problem in two Microsoft.pocketpc usenet groups and no one replied. Here is my problem description, which describes behavior on the WM 6 device: 1. If I am entering data into any application, or trying to send a text message, abou...

Calander Problem
Hi If I want to invite others to a meeting I get "no information". Pls help? Than'x Shay This is a free/busy information absence issue. I think it may require additional information to t-shoot the problem, for example, did all users have the problem or only you have the problem? can anybody else see the user free/busy information? can other people see your free/busy information; As a direction, if the problem is a client side you can use "outlook /cleanfreebusy" or similar switch to re-publish the free/busy info to the server; if it is a server side problem, yo...

Formula Bar Problem
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi- <br><br>I have been having trouble with my formula bar. I have gone to &quot;view&quot; and selected the &quot;formatting pallet&quot; and &quot;formula bar&quot; options, but still it does not appear. What else do I need to do to make it show up? ...

Thank you for Payee List problem solved
So simple but how to know such a thing that a leap year would mess with a drop down list. I guess it has to do with the fact that money only lists payees that you have used in the last 2 years and since this day hasn't occured for 4 years the program is functioning properly, just a bit frustrating though. ...

Access ODBC problem: Excel cannot get float columns
I need some help I'm trying to get Access external data from an Excel workbook, using the MS Query feature. Everything is ok except when I try to fetch some tables that ODBC refuses to get data from. The error message tells that the MS Access ODBC driver doesn't allow some columns to be transmited because of its number of characters. The most strange thing is that I can see the data from MS Query correctly, but I caannot get it back from Excel. After some tries, I thing it occurs only with real typed columns. Can anybody help me? I use Windows XP Home + Office 2000 spanish versio...

re: problem with combo box
I would like to make a little bit modified excel sheet (as in link below, DataValNameId.xls) but it would show on DataEntry datasheet after selecting product from combo box the value of selected ProductId (instead of Product) on column B and also put the value of the Product on the same row to Column C how could I do it ? > Hi > just make the source list larger or use a defined name which adapts > automatically if you add more products > see > http://www.contextures.com/xlNames01.html#Dynamic > > -- > Regards > Frank Kabel > Frankfurt, Germany > > >&g...

Tab Control query problem
I have a tab control on a form with two tabs. The first tab has drop downs for the month/year and other criteria. It also has a button to run a query based on all of the criteria displayed on the form. The second tab also has drop downs for the month/year and different criteria. It also has a button to run a query based on all of the criteria displayed on the form. My problem is that when I am on the second tab, it picks up the month/year field from the first tab in the query results. I does pick up all of the 'other criteria' from the second tab. How do I correct this? ...

Exporting Contacts -- Problems with Mail Merge
I'm trying to export Contacts from Outlook 2002. When I try to export, Outlook tells me that it needs a Translator file from the original Office XP Pro CD. Unfortunately, I can't find this disk. (It came with my wife's Dell Dimension.) Do you know where else I can find these files? I was hoping to download them from Microsoft Support, but they don't seem to make them available. All I want to do is convert the Contacts to a comma- delimited file so that we can import them into a Word mail merge process. Actually, even this is a work-around. My first choice would be t...

Problems using Word as Editor
Am using Office/Outlook 2000. My OS is Windows XPMCE. This just started where I get this error statement: Can't open this item. Microsoft WordMail could not be started. Try one of the following: Close any open dialog boxes in Word. Make susre Word is installed correctly. Close other programs and try again. If I quit Word from the task box or restart my computer, I can open an email and read it in Word because the computer reloads it. If I try to open another or try to write an email I get the message. I've tried reinstalling Office but the problem still persists. I've never had th...

2008 Office Setup Assistant Problems
Hoping that someone might be able to lend their expertise with the problem that I am currently having with Microsoft office 2008. A quick history of the current setup, I have approx 160 macbooks using version 10.5.8 and microsoft Office 2008. All accounts are managed and laptops bound to the LDAP server. That being said, their applications are not managed (had some issues and will work on later). So each time a student logs in and tries to open a microsoft office product (word, excel) the office assistant pops up and a) either crashes or b) allows them to select the participate in customer sur...

Form/Subform Problem
I have a bound form with three subforms. Subforms are all displaying in Datasheet View. I am able to make column width changes to all subforms (double-click right border or manually type in a number or drag to size), but after closing main form and reopening, changes are saved on only two of the three subforms. I have checked Properties of all subforms (numerous times) and have everything identical except for the Record Source (Query of each subform). Before closing, I click File/Save on the MenuBar and the Save icon on the Toolbar (I get a working Hourglass on both for three+ second...

Query from three tables, problem when adding a record
Hi ! I'm using Access 2002/2003. I have three tables A, B and C. Table A has a primary key, which is linked to corresponding foreign keys in tables B and C. The values of the keys are unique in their respective tables. In all three tables, each value occurs at most once. I am using a query Q showing all rows of A, and the rows of B and C in a linked fashion. The query Q allows me to add a new record two A. And I can also add a new record to B and a new record to C at the same time (in the same query row !). But, in case that I add a new record to A only and then leave the query, open...

Problem: Windows 7 Search results emails don't open under outlook
I am using windows 7 Professional (64 bit) as it was pre-installed on my laptop. I also installed a fully updated version of Office 2003 to use Outlook 2003, with all service packs and updates installed. When I use Windows Search, I can no longer open, copy/paste or delete the resulting emails listed, even if the email shows fine in the preview pane. When I double-click on a listed search result (i.e. an email) nothing happens, although it seems the search program tries to open outlook. Is this a known issue ? Is there a fix ? I searched the internet and it seems various peo...

problem with recordset
i have created a recordset based on the records of a subform. It will loop the records to get some information. It works when I tried it. But when I save the form and open it again, click on the command to loop through the subform, it runs as if there are no records (at debugging) even when the subform shows there are records. I go into design mode of the form, view the form again, tried the command and it works. Close the form, open it normal - stop working again... Does it need to be refreshed in some way? How do I overcome this issue? Many thanks in advance RIchard pa...

Problem ze zmienna
Witam, chcialbym uzyskac szablon, ktory bedzie zamienial liczebniki us na pl. Ponizszy szablon nie dziala ze zmienna 'us', komunikat: "Nie mozna uzyskac odwolania do zmiennej lub parametru 'us'. Zmienna lub parametr moga nie byc zdefiniowane lub znajdowac sie w innym zakresie". Zreszta nie dziala takze ze zmienna 'pl' - nie ma powyzszego komunikatu, ale wartosc jest pusta. Jak poprawic ten szablon, by zadzialal. Chyba nie rozumiem tych zmiennych... Pozdrowienia Robert <xsl:template match="liczebniki"> <xsl:variable name="pl"...

subform processing problem
I have a form bound to my Issues table. The form contains a subform bound to my client table. Relationship Issues to Client is many to 1. The subform retrieves data correctly for existing issues and clients. However when I am creating a new Issue, I cant figure out how to populate the client. For a new Issue, the subform appears completely gray. When I click my button to choose a client the code fails with 'you cannot assign a value to this object' - when I attempt to populate the subform fields. When this button is clicked, I first populate the linking field in the main form, thi...

Problems reading Spanish character set
I use outlook mail with word as the editor running on Windows XP. I have a Spanish keyboard. If I go to Control Panel-> Date, Time,Language,Regional Options-> Add Other Languages ->Languages-> Text Services and Input Languages->Details I get the following settings: Default Input Language: Spanish (traditional sort) Installed Services-: ES Spanish (International Sort) Advanced Text Services lnk Correction Keyboard Spanish Now, when I type, all is wel...

Odd Validator Problem
Hi, I seem to have hit an odd problem. I have the need to sometimes validate and sometimes not based on conditions in a database. However, the following page, which simulates the problem, works fine as a stand alone page, but fails at the indicated line when used with a matter page when clicking the NoVal button. It also fails when clicking the val button, but only when with a master page. I have no idea why or how to fix it. Thanks for any help. ====================== <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/CourtTec...

Exmerge Problems
I have migrated all mailboxes from an Exchange 2000 Server to Exchange 2003. I have restored an IS to a Recovery Storage Group. I am trying to use the exmerge tool to pull out one user's information only. I continue to fail on the Exmerge with the "Error opening message store (MSEMS). Verify that the Microsoft Exchange Information Store service is running and that you have the correct permissions to log on. (0x8004011d)" error. I have verified that my account is not denied in any form or fasion, I have permissions everywhere, and the IS is running. In fact, I am able to co...

Money Synchronization Problems
I have been using Money 2003 for Pocket PC for a few months as the main tool for keeping track of my finances. I have recently installed Money 2003 on my laptop but I'm unable to synchronize. When I synchronize, my money data on the Pocket PC gets wiped out and I have to restore it from a backup on the Pocket PC. Here is what I tried: 1- Installed Money 2003 to the default directory on the laptop 2- Reinstalled activesync 3.7 3- Reinstalled Money for pocket PC and made sure it installs to default directories on both the Pocket PC and the laptop 4- Followed the synchronize instructions in t...

Macro chart problem
Is that possible to add a label to a particular data point in the line chart? I used macro to update my charts regularly and automatically, but the labels on particular data points cannot be shifted accordingly when new data point inserted. How can i shift it or fix the label to the particular data point in line chart so that no matter how I update or modify data points the label still sticks or shifts together. Thanks Rob Bovey's chart labeling utility at www.appspro.com puts labels on line charts. You may be able to use that. Perhaps you can remove the labels you don't want. --...

Outlook 2003
Either I've found a bug, or I've got something really broken. With Outlook 2003 (latest patch installed) if I select to reply or forward by attaching the message, my signature isn't placed in the message. If however I select the option to include the text then the signature is attached. This is completely reproducable and I can't find anything about it online. So, anybody else see this? Anybody know how to fix it so that the signature is attached, even when I attach the message to a reply or forward? Thanks. Rob Yes, I'm having the same problem and haven'...

Adv. Budget Debt Problem MM05
I'm trying to setup my advanced budget in MM05. The 1st major problem I see is in the Debt section. It correctly shows a line for Debt Reduction Planner from that setup. That amount INCLUDES my monthly mortgage payment. My mortgage payment is also setup in my Bills & Deposits and that is causing the monthly transfer to ALSO show up under the Debt section in my budget. This means that my monthly mortgage is counted twice in the budget. I can see no way to get it out of there (other than remove it from the debt plan or scheduled monthly bills). Anyone else have such a problem or a...

Outlook 2000 spam deletion problem
Hi I'm a newcomer to this group. I have Outlook 2000 running on win2k with all the available updates, Cloudmark spam detection, Zone Alarm Pro firewall and AVG virus protection also all up to date. My problem is that deleting the contents of the spam folder in Outlook after having checked for false rejections causes an error message to indicate that the programme cannot access plug-in programme .dll files including the virusguard. The error message won't go away and sometimes even task manager doesn't gain control after (control,alt,delete) so we have to reboot. ...

Repeat-a-matic Mouse Button Problem
I need a mouse button which does its thing when clicked, and keeps repeating its thing when held down. I know that the code below is not very sophisticated but I think that it is adequate for my immediate needs. The problem is that when I depress and hold the mouse button down the button does absolutely nothing. When clicked once it does what it should, i.e. deletes the leftmost character. When clicked one and a half times, i.e. clicked once and then immediately depressed and held, it goes into repeat-a-matic mode. But I can't see why it is doing nothing when I depress ...