T
tshad
I am trying to access a method from outside my User Controls and am getting
an error:
Compiler Error Message: BC30456: 'FillGrids' is not a member of
'System.Web.UI.Control'.
I have the method defined as "Public" in my control:
********************************************
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
if not IsPostBack
Call FillGrids()
end if
end sub
Public Sub FillGrids()
....
End Sub
*********************************************
My aspx page (actually another control) is:
****************************************************
<script runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
trace.warn("UserID = " & session("UserID"))
dim IsCheckResumes as Boolean = true
Dim pageControl As Control = LoadControl("RolesAdmin.ascx")
PageUserControl.Controls.Add(pageControl)
Call pageControl.FillGrids() <--- The
error
....
<asp
laceHolder ID="PageUserControl" runat="server"/>
****************************************************
I would also like to be able to access the Method from the PlaceHolder since
I may call it from other functions in my page where the control is not
defined (but the PlaceHolder would be. Something like:
Call PageUserControl.Controls.?.FillGrids()
Do I need define the control differently?
Thanks,
Tom
an error:
Compiler Error Message: BC30456: 'FillGrids' is not a member of
'System.Web.UI.Control'.
I have the method defined as "Public" in my control:
********************************************
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
if not IsPostBack
Call FillGrids()
end if
end sub
Public Sub FillGrids()
....
End Sub
*********************************************
My aspx page (actually another control) is:
****************************************************
<script runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
trace.warn("UserID = " & session("UserID"))
dim IsCheckResumes as Boolean = true
Dim pageControl As Control = LoadControl("RolesAdmin.ascx")
PageUserControl.Controls.Add(pageControl)
Call pageControl.FillGrids() <--- The
error
....
<asp
****************************************************
I would also like to be able to access the Method from the PlaceHolder since
I may call it from other functions in my page where the control is not
defined (but the PlaceHolder would be. Something like:
Call PageUserControl.Controls.?.FillGrids()
Do I need define the control differently?
Thanks,
Tom