I have a user control that's used to display the products listing in the
main part of a page. This control is populated with a listing of products
from the database based on a category name passed into it via a function in
the code behind like this:
'Note, when we aren't looking at products, the product listing user control
gets switched out for a different user control such as aboutus.ascx or
something.
'This is a function in default.aspx code behind
Private Sub LoadProductsListing(ByVal sMenuID As String)
Try
Dim ctl As UserControl
ctl = LoadControl("Content/ProductListing.ascx")
'cellControlHolder is a table cell used to hold the user control
Me.cellControlHolder.Controls.Clear()
Dim ctlProd As ProductListing1 = ctl
'LoadMenu is a function in ProductListing1 codebehind that populates the
grid
ctlProd.LoadMenu(sMenuID)
Me.cellControlHolder.Controls.Add(ctlProd)
Catch ex As Exception
ErrLog(ex.Message, ex.StackTrace)
End Try
End Sub
So unlike a page that can have different versions cached based on the
parameters passed into the url, this user control get populated by calling a
function in its code behind from the parent page. Is there anyway to cache
a different version of this control for each product category?
--
mo*******@nospam.com