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
811 Views

Similar Articles

[PageSpeed] 41



"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:

Here is fix for Windows file problems
If you have installed a Windows update and started having problems opening, closing, copying files, see: http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.excel.misc&mid=1fe358b1-c8eb-4217-ad2a-4b9fcf741916 ...

Problems with Outlook hanging (possibly CRM1.2 problem)
Hi, Apologies for the cross posting, but I'm not sure which is th ebest newsgroup to help... I'm Running a server with SBS 2003 & exchange. Installed CRM1.2 (at the moment it's only on the server & I can access via the web). I've not yet installed the Outlook client on my laptop. The problem is that I've been experiencing major "hangup" problems when connecting my laptop to the server. Everything works fine until I open up Outlook, then, although I an "ping" the server I am unable to access it either from Outlook to synchronise emails, ...

sort problems
Using Publisher 2000 and mail merge - large input excel files - sort sequence is crucial but does not hold. Doing a 20K pice mailing and addresses print out in basically no sequence at all - I've broken database down to 2000 names at a time - it will print 10 in sequence, skip 20, print 10 in sequence, skip 10 then eventually goes back and randomly picks up skipped addresses. I know the file is sorted going in. With mailings this big, this is a MAJOR problem. Anyone know what's happening here. How to solve? Help from Ed Bennett, MVP Adjust the Mail Merge Batch Size. There is ...

Outlook 2003 offline caching changes
There has been a change in the default behavior of Outlook from version 2000 to 2003 with regard to how the offline cache responds when you have previously synchronized the cache, and then reconnect online (in our situation, it's particularly relevant when connecting over a phone line rather than over a broadband or network connection). We're wondering if there's a way to turn back the clock.. In Outlook 2000, you would connect to the online mailbox, and would view all the headers of all the messages in your Inbox, Deleted Items, etc. (you still had to wait for the head...

Query Problems
I have a table of ecards that is populated from a website and includes receiver, sender, and Team leader. The problem I am having is names can be entered into the table like this "Tom Thumb", but Team leader is a dropdown menu that is constant and lists name like this: "Tom S. Thumb". When I make a query to find all the members of Tom S. Thumb's team, I get everyone except Tom Thumb, who is member too. Tom Thumb has his own higher team leader, so I can't change that. How do I get Tom Thumb to be included when I enter "Tom S. Thumb" as Team Leader? ...

Windows update site problems
So whats happening with the windows update site ?I keep getting a message telling me there is a problem with the web page (am trying to update new installation of XP Home),is it me or the site,and when will it be sorted out? -- Be happy,Strat4axe "stat4axe" <strat4axe@hotmail.com(donotspam)> wrote in message news:36618CFD-EF82-4F82-A7C3-90CF2DDCCEA5@microsoft.com... > So whats happening with the windows update site ?I keep getting a message > telling me there is a problem with the web page (am trying to update new > installation of XP Home),is it me o...

Outlook 2003 viewing problem
We are using Outlook 2003 from the Small Business Edition 2003 software, we have wireless router for our LAN and the modem connected to the router. We have 7 PCs in the Office. The problem is only on one computer, the user is receiving emails from people outside OK, but emails sent internally is another matter. Internal emails although they seem to be being received because the sound alert for new messages happens, but then the message doesn't display in any of the mail boxes. Also sending email from that PC to another internal PC on the LAN is not working. I have checked the ru...

Excel problem, File disappeared.
I created a file in Excel on a WinXP PC that I called pron.xls and saved it in the my documents folder, I then decided to move it and using Windows Commander F6 key (Rename and Move) I attempted to move it to a different folder and rename it to prn.xls at the same time. This process caused the file to disappear!! I now realise that this was because prn.xls is an invalid name. I tried to search for the original and new names but neither existed. There is no sign of it in the recycle bin either. Is there anyway of retreiving the lost data? Steve Barrowcliff As far as I'm aware no....

Strange Problem when closing the database object
Hi All, I have a COM component using which is interacting with the database using the CDAODATABASE class. my applications works fine when i built it with VS6. when i built the application with VS2005, the application is suddently unloaded when i am trying to close the database. my database object is CDaoDatabase *m_DB; when my application calls the following method the component is getting unloaded. STDMETHODIMP CFeatureTable::Close() { AFX_MANAGE_STATE(AfxGetStaticModuleState()) HRESULT hRes = S_OK; if (!m_Initialized) return S_OK; TRY_DAO { // Nee...

Too many problems while updating information online
Several of my accounts are unable to update information online using MS Money 2007 Deluxe - ING Direct - Bestbuy Card (HSBC) - MBNA - Bank of America This is frustrating!! Anyone else with the same problems? Just keep trying, eventually it will work. If you're in a bind, download the QIF or OFX files from the institutions web sites -- B of A works better that way anyway :) Paul McKenna <Paul McKenna@discussions.microsoft.com> wrote: >Several of my accounts are unable to update information online using MS Money >2007 Deluxe > >- ING Direct >- Bestbuy Card (HSBC...

Outlook client connect to exchange server 5.5 problem
Outlook client connect to exchange server 5.5, i get the following message box: "The name could not be resolved. The connection to the microsoft exchange server is unavailable. All other clients are able to connect and resolve the mailbox name. I can't ping and resolve the exchange server from the problems outlook client. The problems occur after i run repair the w2k pro. can anyone help? EL can not ping... well start with basic IP testing. use ipconfig /all from a command prompt on the misconfigured client. Check for DHCP default Gateway - make sure it looks like a client t...

FileCopy Problem
I'm using this to copy a file...but it keeps turning red. FileCopy ('\\Backoffice\Data.mdb', '\\Backoffice\Trash') I'm copying Data.mdb to the Trash folder. Gotta be the syntax. Thanks DS Several things appear to be incorrect. First, FileCopy doesn't accept parentheses. Second, \\Backoffice\Data.mdb isn't a valid UNC (you're missing either the server name or the share name) Third, you need a complete file for the destination, not just a folder name. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "DS" &l...

IPicture: problem with transparent
Hello, I have a Win32 project that uses the IPicture class. Here is how I load the picture: OleLoadPicturePath (path, 0, 0, 0x00ffffff, IID_IPicture, (LPVOID *) &pic); everything is fine accept this: the 4th parameter in that function is the color that should be transparent when rendering but it doesn't work. I have a totally white picture and still it draws it. I read in MSDN that only Metafiles and icons can be transparent but even when i made an icon picture it still wasn't transparent. I also confirmed that the picture had the transparent attribute using pic->Get_Attribu...

Access 97 to 2000 conversion problems 08-08-03
I am trying to convert an Access 97 database to Access 2000 but with great difficulty. If I try to load it in Access 2000, the conversion is attempted but on the apparent completion the new database is not saved and the screen is blank. If I try creating a new database and importing everything then this works fine for the data, but no reports or forms are imported. I have tried all the latest patches to MS Office. Any suggestions would be very welcome. ...

Outlook 2003 Folder & Favorite-folder synch/update problems
I've been using Outlook since 1998 and I make my living at software support, so I'm usually hard to stump, but I'm sucking wind on this one. The problems below all started on the remote Outlook copy, so I have to imagine they're connected to the remote setup and OST files. But I've been through the settings and tried to re-synch, cleared the folder store and recreated it, etc., and nothing seems to correct the problems. Can anyone suggest a systematic way to diagnose and fix what's happening? Here's the story: I'm running Outlook 2003 (all current patches: ...

Amazing Problem in AllocPhysMem wince 6.0
Hi I am writing a Port Driver for x86 platform in WinCE 6.0. I want to allocate virtual and equivalent physical memory in driver and mapped it to USER mode to use application. For that I used AllocPhysMem in driver and passed that address through IOCTL calls but i cant use that virtual and physical address in application side. Because AllocPhysMem returns Error Code as 0x57 (meaning Parameter incorrect). But the same code is working in WinCe 5.0. My code snippet is, VirAddress = (LPVOID)AllocPhysMem(32, PAGE_READWRITE|PAGE_NOCACHE, 0, ...

Mismatched Memory -- could this be my problem?
Could mismatched memory modules be the reason why my computer freezes up with some programs? The SIW utility tells me that my two memory modules don't seem to be matched. One is DDR and the other is DDR2. The specs for my ABIT KU8 motherboard call for DDR, not DDR2, if that makes a difference. Here is what the ISW utility shows? MEMORY SUMMARY Maximum Capacity 1024 MBytes Maximum Memory Module Size 4096 Memory Slots 2 Error Correction None DRAM Frequency 163.6 MHz <--- should be 200.07? Memory Timings 3-3-3-7 (CL-RCD-RP-RAS) CAPACITY Slot1 1536MB <--- wrong for K...

Averaging cell's...problems with Div/0
Hi guys. First time poster here so be gentle with me. I am looking fo some assistance averaging a range of 1 to 3 numbers. Here is what I have so far. =(D3+F3+H3)/(IF(C3=0,0,1)+IF(E3=0,0,1)+IF(G3=0,0,1)) This works great. What it does is checks to see if there is a value i the cell, then counts it and divides by the right number. I.E if yo only have two values out of 3 filled in it divides the number by tw instead of 3. My problem... if all 3 fields are 0 then I get a divide by 0 error. Any suggestion on how to fix this? I don't want my spreadsheet to loo messy before I start plu...

Login problem to CRM 3.0
Hi, I installed CRM 3.0 Professional Edition without any error. I can login perfectly from the CRM server either using http://localhost:5555/ or http://appserver:5555/ under the crmadmin user. If I login to an XP workstation with the same user (crmadmin) and specify http://appserver:5555/ in IE6, I got a login window - where I enter the correct DOMAINNAME\crmadmin username and password - and got the following message: "You are not authorized to view this page"..."HTTP Error 401.1 - Unauthorized... I think the prolem is around IIS security, but what shoud be the next step. Th...

Extender problem with GP 10
Hi all, I setup a Dynamics GP 10 system for a customer. The system is used from HRM staff. I used Extender to add a number of extender windows and detail windows. On the Sever all users can access the extender windows but when they login on a separate terminal server (with a client installation) the Extender windows are not accessible. Only the Extender Detail Windows can be seen. When trying to go to the windows all users including sa get the following message: "Not all required fields have been entered for the window <window name>." I went in the extender and opened ...

upload form problem / server question
www.icingpictures.co.uk / win xp / frontpage 2003 Want to create a form with upload file form field - i read on this forum that the server type i use is important - it should be a windows type server with frontpage extensions - i currently use a linux server with front page extensions - do i need to change to a windows server? Thanks for taking a looka t my question. Joyce Yes, you must have a Windows Server, just like you stated you read. -- Tom [Pepper] Willett Microsoft MVP - FrontPage Since 1997 --------------------------- "threademporium" <threademporiu...

outllook 2003 icon problem
I upgraded from outlook 2000 to outlook 2003. My Desktop Icon is the old 2000 icon however all other icons are the new 2003 icon. How can I change my desktop to be the new icon? On Fri, 28 Jan 2005 22:05:36 -0800, "Andre Monostori" <techguy@dslextreme.com> wrote: >I upgraded from outlook 2000 to outlook 2003. My Desktop Icon is the old >2000 icon however all other icons are the new 2003 icon. How can I change >my desktop to be the new icon? > Have you tried deleting it and creating a new one? -- <<<SgtRich>>> Email Client: Microsoft Offi...

Problem causing safe mode startup
I have a problem with Outlook in which everytime it starts I get the error message with the accompanying "do you wnat to let microsoft know about this problem" With either yes or no the next screen is the error message stating that Outlook did not shut down properly and do you want to start in safe mode. A "No" starts the whole cycle over . . .a yes starts it in safe mode with add-ins turned off. I have ran the repair script from the program and from the CD disc. I have uninstalled and reinstalled it as well. Still the same problem and I have not had it befor...

UPDATE KB979202 MS silverlight problem
Hello, I was able to have all updates install, but i'm stuck with this KB979202. When I install it, a box popup (windows Installer) and ask for "enter path to folder containing installlation package silverlight.msi". ??? I try to uninstall silverlight and same message appear and ask for silverlight.msi?? Can anyone help? Thank in advance. By the way, I'm using Windows XP SP3 PRO. "powersupply" <powersupplydot007@gmaildotcom> ���g��l��s�D:O0dCAgz%23KHA.1892@TK2MSFTNGP05.phx.gbl... > Hello, > > I was able to have all updates i...

Fill Down Problem
I'm hoping you guys can help me out. I have a basic formula in cell C2 I want to copy the formula down in the cells below. The problem is that when I click the small black box in the corner of the cell to fill down the same number appears and not the result of the adjacent data. Here is the problem illustrated: 2 2 4 2 2 SUM(A1,B1) 2 5 4 2 5 SUM(A2,B2) 1 7 4 1 7 SUM(A3,B3) 3 1 4 3 1 SUM(A4,B4) It is clear that 4 is not the sum of the rows be...