W
Web Search Store
Hello,
I set up a web page with 2 user controls.
In classic asp, the first one did all the declarations, and the second one
used the values, and could reset it.
In ASP.Net so far I can't see how to relate them so this will work.
This user control defines the properties:
<%@ Control ClassName="topdcl" %>
<script language="vb" runat="server">
Private m_addressesstring as String= "adr,phone,zip,"
Public Property addressesstring() As String
Get
Return m_addressesstring
End Get
Set(ByVal value As String)
m_addressesstring = Value
End Set
End Property
Public Sub topdcl1()
addressesstring= "adr,phone,zip,"
End Sub
</script>
This user control tries to access the public property 'addressstring', but
can't:
<%@ Control ClassName="w" %>
<script language="vb" runat="server">
Public Sub w1()
my_topdcl.addressesstring = addressesstring & ",zip"
End Sub
</script>
Here's the page that calls them:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<%@ Register TagPrefix="Utils" TagName="topdcl" Src="utils/topdcl_try.ascx"
%>
<%@ Register TagPrefix="Utils" TagName="w" Src="utils/w_try.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
<Utils:topdcl id="My_topdcl" runat="server"/>
<Utils:w id="My_w" runat="server"/>
</body>
</html>
Here's the code behind for this page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
My_topdcl.topdcl1()
My_w.w1()
End Sub
I would really appreciate any help.
At this point, my only working solution seems to be to combine all the code
into 1 usercontrol, instead of having several. Then variables can refer to
variables in their own class with no problem.
In classic asp, I used includes with all the 'dim' statements in the first,
and the subroutines in later includes.
Thanks.
Scott Baxter.
I set up a web page with 2 user controls.
In classic asp, the first one did all the declarations, and the second one
used the values, and could reset it.
In ASP.Net so far I can't see how to relate them so this will work.
This user control defines the properties:
<%@ Control ClassName="topdcl" %>
<script language="vb" runat="server">
Private m_addressesstring as String= "adr,phone,zip,"
Public Property addressesstring() As String
Get
Return m_addressesstring
End Get
Set(ByVal value As String)
m_addressesstring = Value
End Set
End Property
Public Sub topdcl1()
addressesstring= "adr,phone,zip,"
End Sub
</script>
This user control tries to access the public property 'addressstring', but
can't:
<%@ Control ClassName="w" %>
<script language="vb" runat="server">
Public Sub w1()
my_topdcl.addressesstring = addressesstring & ",zip"
End Sub
</script>
Here's the page that calls them:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<%@ Register TagPrefix="Utils" TagName="topdcl" Src="utils/topdcl_try.ascx"
%>
<%@ Register TagPrefix="Utils" TagName="w" Src="utils/w_try.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
<Utils:topdcl id="My_topdcl" runat="server"/>
<Utils:w id="My_w" runat="server"/>
</body>
</html>
Here's the code behind for this page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
My_topdcl.topdcl1()
My_w.w1()
End Sub
I would really appreciate any help.
At this point, my only working solution seems to be to combine all the code
into 1 usercontrol, instead of having several. Then variables can refer to
variables in their own class with no problem.
In classic asp, I used includes with all the 'dim' statements in the first,
and the subroutines in later includes.
Thanks.
Scott Baxter.