You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add a Web page named HomePage.aspx in the application. The Web page contains different
controls. You add a newly created custom control named CachedControl to the Web page.
You need to ensure that the following requirements are met:
The custom control state remains static for one minute.
The custom control settings do not affect the cache settings of other elements in the Web page.
What should you do?
A.
Add the following code fragment to the Web.config file of the solution.
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name=”CachedProfileSet” varyByControl=”CachedControl” duration=”60″ />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
B.
Add the following code fragment to the Web.config file of the solution.
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name=”CachedProfileSet” varyByParam=”CachedControl” duration=”60″ />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
C.
Add a class named ProfileCache that inherits from the ConfigurationSection class to
the HomePage.aspx.cs page. Add the following to the Web.config file of the solution.
<ProfileCache profile=”CachedProfileSet” varyByControl=”CachedControl” duration=”60″></ProfileCache>
<caching>
<outputCache enableOutputCache=”true” />
</caching>
D.
Add a class named ProfileCache that inherits from the ConfigurationSection class to
the HomePage.aspx.cs page. Add the following code fragment to the Web.config file of
the solution.
<ProfileCache profile=”CachedProfileSet” varyByParam=”CachedControl” duration=”60″></ProfileCache>
<caching>
<outputCache enableOutputCache=”true” />
</caching>