R
rn5a
I have a user control named Enter.ascx which has 2 TextBoxes. The 2
TextBoxes are named txt1 & txt2. The entire logic of this user control
(like the properties of the 2 TextBoxes using set/get etc.) is
encapsulated in a code behind page named Enter.ascx.vb. The code-behind
also creates TextChanged events for the 2 TextBoxes. This is the code
in Enter.ascx.vb:
Namespace Details
Public Class EnterCB : Inherits UserControl
Public WithEvents txt1 As TextBox
Public WithEvents txt2 As TextBox
'creating a few Properties for the
'2 TextBoxes using Set/Get
'create events for the 2 TextBoxes
Public Event TextChangedEvent(ByVal obj As Object, ByVal ea As
EventArgs)
Protected Sub txt1Changed(ByVal obj As Object, ByVal ea As
EventArgs) Handles txt1.TextChanged
RaiseEvent TextChangedEvent(obj, ea)
End Sub
Protected Sub txt2Changed(ByVal obj As Object, ByVal ea As
EventArgs) Handles txt2.TextChanged
RaiseEvent TextChangedEvent(obj, ea)
End Sub
End Class
End Namespace
This is how I am encompassing the above code behind in Enter.ascx:
<%@ Control Language="VB" Inherits="Details.EnterCB" %>
<asp:TextBox ID="txt1" runat="server"><br>
<asp:TextBox ID="txt2" runat="server">
As such the above user control when registered in an ASPX page works
fine & even the Events associated with the 2 TextBoxes in the user
control fire in the ASPX page when the text in the TextBoxes change.
But Visual Web Developer 2005 Express Edition (which is what I use for
creating & editing ASP.NET apps) throws the following error
'Context' is not a member of 'ASP.enter_ascx'.
when the mouse is moved over the
<%@ Control Language="VB" Inherits="Details.EnterCB" %>
line in Enter.ascx. Now first of all, what does this error mean? What
is 'Context' here? & secondly, why is VWD generating this error?
TextBoxes are named txt1 & txt2. The entire logic of this user control
(like the properties of the 2 TextBoxes using set/get etc.) is
encapsulated in a code behind page named Enter.ascx.vb. The code-behind
also creates TextChanged events for the 2 TextBoxes. This is the code
in Enter.ascx.vb:
Namespace Details
Public Class EnterCB : Inherits UserControl
Public WithEvents txt1 As TextBox
Public WithEvents txt2 As TextBox
'creating a few Properties for the
'2 TextBoxes using Set/Get
'create events for the 2 TextBoxes
Public Event TextChangedEvent(ByVal obj As Object, ByVal ea As
EventArgs)
Protected Sub txt1Changed(ByVal obj As Object, ByVal ea As
EventArgs) Handles txt1.TextChanged
RaiseEvent TextChangedEvent(obj, ea)
End Sub
Protected Sub txt2Changed(ByVal obj As Object, ByVal ea As
EventArgs) Handles txt2.TextChanged
RaiseEvent TextChangedEvent(obj, ea)
End Sub
End Class
End Namespace
This is how I am encompassing the above code behind in Enter.ascx:
<%@ Control Language="VB" Inherits="Details.EnterCB" %>
<asp:TextBox ID="txt1" runat="server"><br>
<asp:TextBox ID="txt2" runat="server">
As such the above user control when registered in an ASPX page works
fine & even the Events associated with the 2 TextBoxes in the user
control fire in the ASPX page when the text in the TextBoxes change.
But Visual Web Developer 2005 Express Edition (which is what I use for
creating & editing ASP.NET apps) throws the following error
'Context' is not a member of 'ASP.enter_ascx'.
when the mouse is moved over the
<%@ Control Language="VB" Inherits="Details.EnterCB" %>
line in Enter.ascx. Now first of all, what does this error mean? What
is 'Context' here? & secondly, why is VWD generating this error?