Author: mrugesh | Posted on: 7/23/2008 6:46:28 PM | Views : 355

Following is the code i am trying 

Master Page :-

<%@ Reference Control="~/Modules/NavigationTools/Promotions/PromoPanel.ascx" %>
<asp:Substitution ID="TestControl" runat="server" MethodName="GetAds" />
Code behind:- 
Protected Shared Function GetAds(ByVal context As HttpContext) As String
        Dim ads As UserControl = CType(myPage.LoadControl("~/Modules/NavigationTools/Promotions/PromoPanel.ascx"), UserControl)
        Dim sw As New StringWriter()
        Dim htw As New HtmlTextWriter(sw)
        ads.RenderControl(htw)
       context.Cache.Insert("Ads", sw.ToString())

        Return TryCast(context.Cache("Ads" ...

Go to the complete details ...