C
Craig
I'm having a problem calling a public method for a web user control. When I
reference the UC's id (MyTester) from within default.aspx.vb, I get a message
that the variable has not been declared. I'm posting the code below, can
anyone help out with this.
the statement that throws the error is:
[default.aspx.vb]
MyTester.SetAppInfo(1001)
[default.aspx]
<%@ Register tagprefix="test" tagname="Message"
src="UserControls/tester.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb"
Inherits="MasterSite._default"%>
[snip]
<form id="Form1" method="post" runat="server">
<test:message id="MyTester" runat="server" />
</form>
[snip]
[default.aspx.vb]
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
MyTester.SetAppInfo(1001)
end Sub
[tester.ascx]
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="tester.ascx.vb" Inherits="MasterSite.tester"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:Label id="lblTester" runat="server"></asp:Label>
[tester.ascx.vb]
Public Class tester
Inherits System.Web.UI.UserControl
Private _AppId As Integer
[snip]
Public Sub SetAppInfo(ByVal AppId As Integer)
'do some biz logic here
_AppId = AppId
End Sub
End Class
reference the UC's id (MyTester) from within default.aspx.vb, I get a message
that the variable has not been declared. I'm posting the code below, can
anyone help out with this.
the statement that throws the error is:
[default.aspx.vb]
MyTester.SetAppInfo(1001)
[default.aspx]
<%@ Register tagprefix="test" tagname="Message"
src="UserControls/tester.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb"
Inherits="MasterSite._default"%>
[snip]
<form id="Form1" method="post" runat="server">
<test:message id="MyTester" runat="server" />
</form>
[snip]
[default.aspx.vb]
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
MyTester.SetAppInfo(1001)
end Sub
[tester.ascx]
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="tester.ascx.vb" Inherits="MasterSite.tester"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:Label id="lblTester" runat="server"></asp:Label>
[tester.ascx.vb]
Public Class tester
Inherits System.Web.UI.UserControl
Private _AppId As Integer
[snip]
Public Sub SetAppInfo(ByVal AppId As Integer)
'do some biz logic here
_AppId = AppId
End Sub
End Class