473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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.Controls.Clear();

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

Content.Controls.Add(Control1);
}
else
{
Control2 = (Control2) LoadControl ("MyUserControl2.ascx");

Content.Controls.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 19 '05 #1
1 822
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.Controls.Clear();

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

Content.Controls.Add(Control1);
}
else
{
Control2 = (Control2) LoadControl ("MyUserControl2.ascx");

Content.Controls.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 19 '05 #2

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

Similar topics

6
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...
10
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...
1
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...
0
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...
2
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...
3
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...
2
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...
2
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...
6
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...
12
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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,...
0
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...

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.