473,503 Members | 1,768 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.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 17 '05 #1
1 1416
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 17 '05 #2

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

Similar topics

6
1548
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
1414
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
2148
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
1130
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
1249
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
2465
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
1594
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
1040
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
1386
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
2039
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
7199
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
7076
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
7453
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...
0
5576
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,...
1
5005
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...
0
4670
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...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1507
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 ...
1
732
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.