S
Stephan
Hi all,
when trying to build a custom webcontrol I receive the above message.
It's caused by the inherits attribute of de the control-directive. I
have no clou of what could be going wrong. Any help is appreciated:
Code of the control:
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="control_DatePicker.aspx.vb"
inherits="UserWebControl.DatePicker"%>
<table cellpadding="0" cellspacing="2" border="0">
<tr>
<td align="right"><asp:TextBox id="tbxDatum" runat="server"
Width="92px" MaxLength="10"></asp:TextBox></td>
<td align="middle">
<asp:ImageButton id="ImageButton1" runat="server"
ImageUrl="images/cal.gif"></asp:ImageButton></td>
</tr>
<tr>
<td colspan="2" height="0px">
<aspanel id="cal1" runat="server" style="CLEAR: none; DISPLAY:
block; FLOAT: left; OVERFLOW: visible; POSITION: absolute"
Visible="False">
<asp:Calendar id="calendar1" runat="server" Width="200px"
BackColor="White" DayNameFormat="FirstLetter" ForeColor="Black"
Height="180px" Font-Size="8pt" Font-Names="Verdana"
BorderColor="#999999" CellPadding="4">
<TodayDayStyle ForeColor="Black"
BackColor="#CCCCCC"></TodayDayStyle>
<SelectorStyle BackColor="#CCCCCC"></SelectorStyle>
<NextPrevStyle VerticalAlign="Bottom"></NextPrevStyle>
<DayHeaderStyle Font-Size="7pt" Font-Bold="True"
BackColor="#CCCCCC"></DayHeaderStyle>
<SelectedDayStyle Font-Bold="True" ForeColor="White"
BackColor="#666666"></SelectedDayStyle>
<TitleStyle Font-Bold="True" BorderColor="Black"
BackColor="#999999"></TitleStyle>
<WeekendDayStyle BackColor="#FFFFCC"></WeekendDayStyle>
<OtherMonthDayStyle ForeColor="#808080"></OtherMonthDayStyle>
</asp:Calendar>
</aspanel></td>
</tr>
</table>
Sourcecode codebehind-file:
Imports System
Imports System.Web
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.UserControl
Namespace UserWebControl
Public Class DatePicker : Inherits UserControl
Protected WithEvents tbxDatum As
System.Web.UI.WebControls.TextBox
Protected WithEvents ImageButton1 As
System.Web.UI.WebControls.ImageButton
Protected WithEvents calendar1 As
System.Web.UI.WebControls.Calendar
Protected WithEvents cal1 As System.Web.UI.WebControls.Panel
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form
Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub calendar1_SelectionChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
calendar1.SelectionChanged
Dim selectedDatum As System.DateTime =
calendar1.SelectedDate
tbxDatum.Text = selectedDatum.ToShortDateString
cal1.Visible = False
End Sub
Private Sub ImageButton1_Click(ByVal sender As System.Object,
ByVal e As System.Web.UI.ImageClickEventArgs) Handles
ImageButton1.Click
If cal1.Visible = True Then
cal1.Visible = False
Else : cal1.Visible = True
End If
End Sub
End Class
End Namespace
when trying to build a custom webcontrol I receive the above message.
It's caused by the inherits attribute of de the control-directive. I
have no clou of what could be going wrong. Any help is appreciated:
Code of the control:
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="control_DatePicker.aspx.vb"
inherits="UserWebControl.DatePicker"%>
<table cellpadding="0" cellspacing="2" border="0">
<tr>
<td align="right"><asp:TextBox id="tbxDatum" runat="server"
Width="92px" MaxLength="10"></asp:TextBox></td>
<td align="middle">
<asp:ImageButton id="ImageButton1" runat="server"
ImageUrl="images/cal.gif"></asp:ImageButton></td>
</tr>
<tr>
<td colspan="2" height="0px">
<aspanel id="cal1" runat="server" style="CLEAR: none; DISPLAY:
block; FLOAT: left; OVERFLOW: visible; POSITION: absolute"
Visible="False">
<asp:Calendar id="calendar1" runat="server" Width="200px"
BackColor="White" DayNameFormat="FirstLetter" ForeColor="Black"
Height="180px" Font-Size="8pt" Font-Names="Verdana"
BorderColor="#999999" CellPadding="4">
<TodayDayStyle ForeColor="Black"
BackColor="#CCCCCC"></TodayDayStyle>
<SelectorStyle BackColor="#CCCCCC"></SelectorStyle>
<NextPrevStyle VerticalAlign="Bottom"></NextPrevStyle>
<DayHeaderStyle Font-Size="7pt" Font-Bold="True"
BackColor="#CCCCCC"></DayHeaderStyle>
<SelectedDayStyle Font-Bold="True" ForeColor="White"
BackColor="#666666"></SelectedDayStyle>
<TitleStyle Font-Bold="True" BorderColor="Black"
BackColor="#999999"></TitleStyle>
<WeekendDayStyle BackColor="#FFFFCC"></WeekendDayStyle>
<OtherMonthDayStyle ForeColor="#808080"></OtherMonthDayStyle>
</asp:Calendar>
</aspanel></td>
</tr>
</table>
Sourcecode codebehind-file:
Imports System
Imports System.Web
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.UserControl
Namespace UserWebControl
Public Class DatePicker : Inherits UserControl
Protected WithEvents tbxDatum As
System.Web.UI.WebControls.TextBox
Protected WithEvents ImageButton1 As
System.Web.UI.WebControls.ImageButton
Protected WithEvents calendar1 As
System.Web.UI.WebControls.Calendar
Protected WithEvents cal1 As System.Web.UI.WebControls.Panel
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form
Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub calendar1_SelectionChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
calendar1.SelectionChanged
Dim selectedDatum As System.DateTime =
calendar1.SelectedDate
tbxDatum.Text = selectedDatum.ToShortDateString
cal1.Visible = False
End Sub
Private Sub ImageButton1_Click(ByVal sender As System.Object,
ByVal e As System.Web.UI.ImageClickEventArgs) Handles
ImageButton1.Click
If cal1.Visible = True Then
cal1.Visible = False
Else : cal1.Visible = True
End If
End Sub
End Class
End Namespace