T
tepesco
Hi..
I'm trying to create small custom control.. class definition in vb looks
like:
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Resources
Imports System.ComponentMode
Imports Anthem
Namespace WebContr.WebControls
Public Class DynamicList
Inherits System.Web.UI.WebControls.WebControl
Implements INamingContainer
Protected Overloads Sub CreateChildControls()
Me.Controls.Clear()
Me.InitializeComponent()
End Sub
''' <summary>
''' Initializes the contained controls
''' </summary>
Private Sub InitializeComponent()
listBox = New Anthem.ListBox()
btUp = New Anthem.Button
btDown = New Anthem.Button
Me.btDown.Text = "Down"
Me.btUp.Text = "Up"
listBox.Visible = True
btUp.Visible = True
btDown.Visible = True
Me.Controls.Add(listBox)
Me.Controls.Add(btUp)
Me.Controls.Add(btDown)
End Sub
Protected Overloads Sub Render(ByVal render As HtmlTextWriter)
Me.EnsureChildControls()
Me.Render(render)
End Sub
Private listBox As Anthem.ListBox
Private btUp As Anthem.Button
Private btDown As Anthem.Button
End Class
End Namespace
And using it in aspx :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<%@ Register TagPrefix="webCtrl" Namespace="WebContr.WebControls"
Assembly="WebContr.WebControls" %>
<html>
<head>
</head>
<body>
<webCtrl
ynamicList runat="server" Width="300" Height="300"
ID="dynList" Visible="true"></webCtrl
ynamicList>
</body>
</html>
But site is blank, what i'm doing wrong? thanks for answers
Regards
I'm trying to create small custom control.. class definition in vb looks
like:
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Resources
Imports System.ComponentMode
Imports Anthem
Namespace WebContr.WebControls
Public Class DynamicList
Inherits System.Web.UI.WebControls.WebControl
Implements INamingContainer
Protected Overloads Sub CreateChildControls()
Me.Controls.Clear()
Me.InitializeComponent()
End Sub
''' <summary>
''' Initializes the contained controls
''' </summary>
Private Sub InitializeComponent()
listBox = New Anthem.ListBox()
btUp = New Anthem.Button
btDown = New Anthem.Button
Me.btDown.Text = "Down"
Me.btUp.Text = "Up"
listBox.Visible = True
btUp.Visible = True
btDown.Visible = True
Me.Controls.Add(listBox)
Me.Controls.Add(btUp)
Me.Controls.Add(btDown)
End Sub
Protected Overloads Sub Render(ByVal render As HtmlTextWriter)
Me.EnsureChildControls()
Me.Render(render)
End Sub
Private listBox As Anthem.ListBox
Private btUp As Anthem.Button
Private btDown As Anthem.Button
End Class
End Namespace
And using it in aspx :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<%@ Register TagPrefix="webCtrl" Namespace="WebContr.WebControls"
Assembly="WebContr.WebControls" %>
<html>
<head>
</head>
<body>
<webCtrl

ID="dynList" Visible="true"></webCtrl

</body>
</html>
But site is blank, what i'm doing wrong? thanks for answers
Regards