Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / July 2004

Tip: Looking for answers? Try searching our database.

How to Cache a user Control?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Malik Asif Joyia - 02 Jul 2004 06:59 GMT
Hello
I have a User Control which i used on each page of whole webapplication. i
want to cache that control so that web application become speedy.
I am new to implement asp.net Cache Facility. Kindly help me to carry out
this task. Thanks
ranganh - 02 Jul 2004 08:03 GMT
Dear Asif,

In the UserControl, Put the following code in the top next to the "@ Control Directive" line,

<%@ OutputCache Duration="10" VaryByParam="None" %>

The above code would make the usercontrol being cached every 10 seconds.

Hope it helps

> Hello
> I have a User Control which i used on each page of whole webapplication. i
> want to cache that control so that web application become speedy.
> I am new to implement asp.net Cache Facility. Kindly help me to carry out
> this task. Thanks
Malik Asif Joyia - 02 Jul 2004 11:40 GMT
Hello

When I cache a Header Control in which I have page header images. And a link
button control. Which I use to logoff the user. But when I implement the
Cache . Writing line to header control file .ascx

<%@ OutputCache Duration="120" VaryByParam="none" VaryByCustom="Browser"
Shared="true" %>

But After Implementing this page Give a Java Script Error "Object Not
Found"..this is the error in code generated for linkbutton control.

Thanks

> Dear Asif,
>
[quoted text clipped - 11 lines]
> > I am new to implement asp.net Cache Facility. Kindly help me to carry out
> > this task. Thanks
Mr. Dot Net - 07 Jul 2004 10:50 GMT
I guess that's because you're registering javascript to the page in the user
control's code.
something like this:

uc.Page.RegisterScriptBlock etc...

Since the control is loaded from cache there is no way that the code will
loaded as well since it's in a different container: the page instead of the
user control.

One way to solve this is put the script block inside the user control's
container.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.