Scratch my last post. This is what I am trying to do.
My Skin file contains
<%@ Register TagPrefix="ccc" TagName="CARTCOUNTER" Src="~/Admin/Skins/CartCounter.ascx" %>
<ccc:CARTCOUNTER runat="server" ID="CARTCOUNTER" />
My User Control contains
<%@ Control Language="VB" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Controls.CartCounter" CodeFile="CartCounter.ascx.vb" %>
<asp:Label ID="lblCartCounter" runat="server" style="padding: 0 0 0 5px;" cssclass="SkinObject" /> Item(s)
Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
If Not Session("TagCatalogOrderCart") Is Nothing Then
Update_Counter(CType(Session("TagCatalogOrderCart"), System.Data.DataTable).Rows.Count)
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Public Sub Update_Counter(ByVal value As String)
lblCartCounter.Text = value
End Sub
My Module Contains
<%@ Register TagPrefix="ccc" TagName="CARTCOUNTER" Src="~/Admin/Skins/CartCounter.ascx" %>
<asp:UpdatePanel ID="updateTagCatalog" runat="server" UpdateMode="Always">
<ContentTemplate>
ORDER FORM HERE........with add to cart button
</ContentTemplate>
</asp:UpdatePanel>
Code: This gets called once the add to cart button is clicked
Protected Sub UpdateCartGUI()
Dim Skin As DotNetNuke.UI.Skins.Skin
Skin = Skin.GetSkin(Page)
Dim uc As DotNetNuke.UI.Skins.Controls.CartCounter
uc = CType(Skin.FindControl("CARTCOUNTER"), Skins.Controls.CartCounter)
uc.Update_Counter(CType(Session("TagCatalogOrderCart"), System.Data.DataTable).Rows.Count)
End Sub
The problem is the user control always updates 1 click behind. I'm not sure how to resolve this, but any help will really be appreciated!!!
Thanks,
Frank