C
Christian Perthen
Hi,
I have a sub in the codebehind page of a user control file that writes html.
How do I get the sub triggered and output the html in the content page?
See my approach below.
Partial Class contentAffiliate
Inherits System.Web.UI.UserControl
Sub Page_Load()
writeContentAffiliateSub(1, 1)
End Sub
Sub writeContentAffiliateSub(ByVal intDisplayMode As Integer, ByVal
intPageID As Integer)
Response.Write("<table cellpadding=""0"" cellspacing=""0""><tr>")
Response.Write("<td nowrap " & writeActiveTab(intPageID, 1) & "><a
href=""affiliate_list.aspx"">Active Affiliates</a></td>")
Response.Write("<td nowrap " & writeActiveTab(intPageID, 2) & "><a
href=""affiliate_list.aspx?active=1"">Temporary Affiliates</a></td>")
Response.Write("<td nowrap " & writeActiveTab(intPageID, 3) & "><a
href=""affiliate_list.aspx?active=0"">Inactive Affiliates</a></td>")
Response.Write("<td nowrap " & writeActiveTab(intPageID, 4) & "><a
href=""affiliate_new.asp"">New Affiliate</a></td>")
Response.Write("<td nowrap " & writeActiveTab(intPageID, 5) & "><a
href=""affiliate_usage.asp"">Affiliate Usage</a></td>")
Response.Write("</tr></table>")
End Sub
Function writeActiveTab(ByVal intPageID As Integer, ByVal intTabID As
Integer) As String
If intPageID = intTabID Then
writeActiveTab = "class=""active"""
Else
writeActiveTab = "class=""inactive"""
End If
End Function
End Class
in the content page I have:
<%@ Register TagPrefix="tab" TagName="contentAffiliate"
Src="~\controls\contentAffiliate.ascx" %>
<tab:contentAffiliate id="contentAffiliate"
runat="server"/></tab:contentAffiliate>
But nothing is generated
Any insight on this?
Thanks in advance
Christian
I have a sub in the codebehind page of a user control file that writes html.
How do I get the sub triggered and output the html in the content page?
See my approach below.
Partial Class contentAffiliate
Inherits System.Web.UI.UserControl
Sub Page_Load()
writeContentAffiliateSub(1, 1)
End Sub
Sub writeContentAffiliateSub(ByVal intDisplayMode As Integer, ByVal
intPageID As Integer)
Response.Write("<table cellpadding=""0"" cellspacing=""0""><tr>")
Response.Write("<td nowrap " & writeActiveTab(intPageID, 1) & "><a
href=""affiliate_list.aspx"">Active Affiliates</a></td>")
Response.Write("<td nowrap " & writeActiveTab(intPageID, 2) & "><a
href=""affiliate_list.aspx?active=1"">Temporary Affiliates</a></td>")
Response.Write("<td nowrap " & writeActiveTab(intPageID, 3) & "><a
href=""affiliate_list.aspx?active=0"">Inactive Affiliates</a></td>")
Response.Write("<td nowrap " & writeActiveTab(intPageID, 4) & "><a
href=""affiliate_new.asp"">New Affiliate</a></td>")
Response.Write("<td nowrap " & writeActiveTab(intPageID, 5) & "><a
href=""affiliate_usage.asp"">Affiliate Usage</a></td>")
Response.Write("</tr></table>")
End Sub
Function writeActiveTab(ByVal intPageID As Integer, ByVal intTabID As
Integer) As String
If intPageID = intTabID Then
writeActiveTab = "class=""active"""
Else
writeActiveTab = "class=""inactive"""
End If
End Function
End Class
in the content page I have:
<%@ Register TagPrefix="tab" TagName="contentAffiliate"
Src="~\controls\contentAffiliate.ascx" %>
<tab:contentAffiliate id="contentAffiliate"
runat="server"/></tab:contentAffiliate>
But nothing is generated
Any insight on this?
Thanks in advance
Christian