473,794 Members | 2,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Control Question

Hi All,

I've decided to code a web user control that uses the ASP.NET Repeater
control to render the output. This web user control obtains its data
from a web service. If I were to use fragment caching (<%@ OutputCache
Duration="3600" %>) with this control, will it call the web service each
time the page is requested or will it continue to use the web service
data until the cache duration expires?

I'd like to know as I'm trying to minimize the total number of requests
to the web service.

Thanks,

Roshawn
Nov 19 '05 #1
2 1259
"Roshawn Dawson" <ud****@bellsou th.net> wrote in message news:uN******** ******@TK2MSFTN GP10.phx.gbl...
This web user control obtains its data from a web service. If I were to use
fragment caching (<%@ OutputCache Duration="3600" %>) with this control,
will it call the web service each time the page is requested or will it continue to
use the web service data until the cache duration expires?


The answer is Yes, output caching the user control (fragment caching) will
reduce the number of calls you're making to the web service.

Fragment caching produces the HTML from the user control the first-time it
gets requested which will include calling your web service. Thereafter, until
the fragment of HTML associated with your user control in the output cache
expires, ASP.NET will render the HTML that's been stored (and not perform
any dynamic processing of your user control, therefore it would not call the
web service). When the fragment in the cache expires, and a request comes
in that requires the HTML of your user control, then ASP.NET will again
perform the dynamic processing in your control (including a call to the web
service) to create a refreshed fragment which it will then return (and cache)
for another 3,600 seconds.
Derek Harmon
Nov 19 '05 #2
Thank you for your response. This is very useful stuff!

Derek Harmon wrote:
"Roshawn Dawson" <ud****@bellsou th.net> wrote in message news:uN******** ******@TK2MSFTN GP10.phx.gbl...
This web user control obtains its data from a web service. If I were to use
fragment caching (<%@ OutputCache Duration="3600" %>) with this control,
will it call the web service each time the page is requested or will it continue to
use the web service data until the cache duration expires?

The answer is Yes, output caching the user control (fragment caching) will
reduce the number of calls you're making to the web service.

Fragment caching produces the HTML from the user control the first-time it
gets requested which will include calling your web service. Thereafter, until
the fragment of HTML associated with your user control in the output cache
expires, ASP.NET will render the HTML that's been stored (and not perform
any dynamic processing of your user control, therefore it would not call the
web service). When the fragment in the cache expires, and a request comes
in that requires the HTML of your user control, then ASP.NET will again
perform the dynamic processing in your control (including a call to the web
service) to create a refreshed fragment which it will then return (and cache)
for another 3,600 seconds.
Derek Harmon

Nov 19 '05 #3

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

Similar topics

11
1686
by: Lloyd Sheen | last post by:
Is there any one who has actually done this. I have now scanned more web articles about this with the realization that not one of them (including MSDN docs) outlines how to do this. This is beyond frustration. It seems that with every new VS release the documentation falls further behind. What I want to do should be simple but I can find no way to do it with VS with any visual designer support. I thought the 'V' in VS stood for...
6
402
by: Jim Heavey | last post by:
Hello, I have a user control which I place at the top of each page. I want to have code in this user control which sets the value of a couple of module variables and I was wondering if I create a Variable name of "Public string Fred" in the control, will the page that uses the control be able to see this global variable or is there something that I need to do to make it available to the page which uses the control Thanks in advance for your...
1
1022
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a variable (targetId) in to the usercontrol (IntergySite.aspx) by calling its setter method. Currently, I am using if-then-else and hardcoded the User Control Object to do casting and call the setter method. Question: Is there any way I could load,...
8
1501
by: Prince Mathew | last post by:
Hi All, I have a requirement. I am throwing an exception from my user control I want to catch this in my container page. Is this possible? I don't want any event to be raised. PLEASE HELP ME.
0
1173
by: campwes | last post by:
Hey there. I have a user control on an aspx page that displays data based on a query (handled by another user control also on the page). I've noticed that the first time I navigate to the page with the user control, I can click on links, buttons etc on the user control and navigate around. On subsequent postbacks, say when a user submits a new query, the buttons and links on the user control are "un-clickable". You get no click sound...
0
1159
by: Brian Cesafsky | last post by:
I am using framework 1.1 I have a user control and a web page. I want to set up properties on the user control, so I can access the text boxes on the user control when I am in the code behind page of the 'main' web page. I have done this so far...
0
978
by: Brian Cesafsky | last post by:
I am using framework 1.1 I have a user control and a web page. I want to set up properties on the user control, so I can access the text boxes on the user control when I am in the code behind page of the 'main' web page. I have done this so far...
1
1822
by: weboweb | last post by:
Hello aspnet experts! I have a design question for the more experienced developers (more than me at least :-)). 1) I have a page in the application I'm building that displays a web user control with a list of folders (let's call it the TREE) 2) There is another control called document list which shows the list of documents for the selected tree folder (let's call it DOCLIST)
9
3194
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will load with different data (locations, departments, etc.).
4
2493
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried unsuccessfully in creating the whole pane as a user control and have succeeded in adding the pane and then dynamically adding the content which is a user control to the pane, dynamically within the page. However I would like to have a single pane...
0
9671
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10212
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7538
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
6777
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
5436
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4112
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
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2919
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.