473,657 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Caching question ASPNET and C#

Hi,

I have a wierd situation on my website, can anyone help me?

Scenario:
I have a page that depending what parameter receives loads one usercontrol
or other one.

Problem:
Sometimes when I click the link that goes to that page the page suddenly
appears with the wrong usercontrol and then flicks to the correct one, it
seems that is responding with the cache but after the execution shows the
correct one.

Generic code:

private MyUserControl Control1;
private MyUserControl2 Control2;
private TableCell Content;

On_Load()
{
Content.Control s.Clear();

if (MyCondition)
{
Control1 = (Control1) LoadControl ("MyUserControl .ascx");

Content.Control s.Add(Control1) ;
}
else
{
Control2 = (Control2) LoadControl ("MyUserControl 2.ascx");

Content.Control s.Add(Control2) ;
}
}

I have not change the ASPX Page, so it has its default configuration, no
caching specified, only AutoEventWireup = "false"

Any ideas why is this happening? Is there any way to force the page not to
render until all the server code is executed?

Thanks a lot
Salva


--
Salvador

Nov 17 '05 #1
1 1421
Salva,

These are just some guesses...

http://www.highdots.com/forums/archi.../t-704364.html. This
suggest using smartnavigation but there are known issues with that so be
aware.

Or try:

http://www.4guysfromrolla.com/webtec...ner/faq3.shtml which talks
about the Response.Buffer property

HTH, Dave.
"Salvador" wrote:
Hi,

I have a wierd situation on my website, can anyone help me?

Scenario:
I have a page that depending what parameter receives loads one usercontrol
or other one.

Problem:
Sometimes when I click the link that goes to that page the page suddenly
appears with the wrong usercontrol and then flicks to the correct one, it
seems that is responding with the cache but after the execution shows the
correct one.

Generic code:

private MyUserControl Control1;
private MyUserControl2 Control2;
private TableCell Content;

On_Load()
{
Content.Control s.Clear();

if (MyCondition)
{
Control1 = (Control1) LoadControl ("MyUserControl .ascx");

Content.Control s.Add(Control1) ;
}
else
{
Control2 = (Control2) LoadControl ("MyUserControl 2.ascx");

Content.Control s.Add(Control2) ;
}
}

I have not change the ASPX Page, so it has its default configuration, no
caching specified, only AutoEventWireup = "false"

Any ideas why is this happening? Is there any way to force the page not to
render until all the server code is executed?

Thanks a lot
Salva


--
Salvador

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1556
by: kevin | last post by:
Could someone explain, Caching. I understand Caching as simply saving a copy of something that is unlikely to change and to which you frequently refer as opposed to retrieving a fresh copy every time... like throwing something into Application in ASP3. Now that Iam all "up to date" everyone wants to Cache everything because its "good shit!". How is Cached data any different than data you place in a globally accesible variable?
10
1426
by: Jon Maz | last post by:
Hi, My goal is to take the entire html/javascript stream spat out by .aspx pages and save them as simple strings in a database (for caching purposes). I'm not sure how I can get hold of this html stream, though - does anyone have any strategies / code samples to get me going? Thanks,
1
2155
by: Dave Bartlett | last post by:
I'm wondering why, when I turn on output caching for a page using: outputcache duration="60" varybyparam="*" Location="Any" that it appears not to cache on the clientside. No Temporary Internet Files are generated and subsequent requests to the same page always do a round trip to the server. Any ideas?
0
1139
by: Evgeny | last post by:
I'm trying to do server caching for some pages of a website I developed. All the pages include the same user control to which they pass a parameter. In this user control I have the following 4 lines. Response.Cache.SetValidUntilExpires(true); Response.Cache.SetCacheability(HttpCacheability.Server); Response.Cache.SetExpires(DateTime.Now.AddDays(7)); Response.Cache.VaryByParams = true;
2
1261
by: Andrew Robinson | last post by:
I have a web site that is running with two web servers and a third server running MSDE. I have successfully installed and am running with SQL based Session. How do I purge the ASPStateTempSessions table from time to time? It appears that there might have been some type of automatic script that was run with the full blown version of SQL under the Server Agent, but that does not exist with MSDE.
3
2479
by: DC | last post by:
Hi, (ASP.Net 1.1) is it possible to (programmatically and globally) deactivate page fragment caching? We have only two scenarios, development stage where we want caching off and testing where we want caching on. Is this doable? I think there is a config switch in 2.0, anything in 1.1? TIA for any hint,
2
1604
by: Nalaka | last post by:
Hi, I have the following requirement for caching a asp.net 2.0 page. Can some one please tell me if this is possible.... and a some direction would also be wonderful I have a ASP.net 2.0 page with 1 user control. 1.1 I want the main page to be cached for a day.
2
1046
by: Peter Afonin | last post by:
Hello, I'm making my first image gallery in ASP.NET. I've never worked with images in ASP.NET before. Everything is going well so far, but what's bothering me is thumbnails flickering when the user reloads the page. Example - http://www.russiannature.com/gallery2.aspx I've heard about the thumbnails caching and tried to find some information on the web, and I found it, but couldn't understand - is it actually good or bad thing? Some...
6
1395
by: Phil Sandler | last post by:
All, I am designing a system that will involve an IIS/ASP.Net application server. The main purpose of the application server will be to load large amounts of static data into memory and do fast lookups on it. The total cache size at the time of first installation will be roughly 350MB, but may grow to as large as 10GB over the next five years. My questions:
12
2060
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I'm using ASP.Net with an UpdatePanel. When the screen is exercised via a Web Test, the Web Test shows that the AJAX scripts are downloaded for every partial post back. My impression was that IE would cache these scripts so that the AJAX script download would only occur once. What am I missing?
0
8821
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8502
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8602
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7316
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.