PC Review


Reply
Thread Tools Rate Thread

Caching question ASPNET and C#

 
 
=?Utf-8?B?U2FsdmFkb3I=?=
Guest
Posts: n/a
 
      23rd Jun 2005
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGF2ZQ==?=
Guest
Posts: n/a
 
      23rd Jun 2005
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
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASPNET 3.0 newbie question ckkwan@my-deja.com Microsoft ASP .NET 5 16th May 2008 02:35 PM
question about aspnet 3.5 and IIS 5.1 Bob Microsoft ASP .NET 2 17th Nov 2007 12:56 PM
question about caching using the caching application block EL 2 =?Utf-8?B?YWhtX2VidXNpbmVzc190cg==?= Microsoft Dot NET Framework 0 19th Sep 2005 06:51 PM
Caching question ASPNET and C# =?Utf-8?B?U2FsdmFkb3I=?= Microsoft C# .NET 1 23rd Jun 2005 09:56 PM
caching in aspnet =?Utf-8?B?RXZnZW55?= Microsoft ASP .NET 0 18th May 2005 06:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 PM.