G
Guest
Hi all,
Consider the following ASP program.
`````````````
OLD ASP STYLE
`````````````
~~~~~~~~~~
header.inc
~~~~~~~~~~
<html>
<body>
<table .......>
<tr>
<td><%=DEFINED_VAR%></td> <!-- DEFINED VAR WILL BE DEFINED AT THE TOP
OF EACH PAGE -->
</tr>
</table>
~~~~~~~~~~
footer.inc
~~~~~~~~~~
</body>
</html>
~~~~~~~~~~
index.asp
~~~~~~~~~~
<%@ Language="VB" %>
<%
Dim DEFINED_VAR
DEFINED_VAR = "Print this"
%>
<!-- #include file="header.inc"-->
<!-- #include file="footer.inc"-->
`````````````
..NET STYLE
`````````````
~~~~~~~~~~
header.ascx
~~~~~~~~~~
<%@ Control language="VB" AutoEventWiredUp=False
Codebehind="HeaderControl.aspx.vb" %>
<html>
<body>
<table .......>
<tr>
<td><%=DEFINED_VAR%></td> <!-- It reports me an error at this point -->
</tr>
</table>
~~~~~~~~~~
footer.ascx
~~~~~~~~~~
<%@ Control language="VB" AutoEventWiredUp=False
Codebehind="FooterControl.aspx.vb" %>
</body>
</html>
~~~~~~~~~~
index.aspx
~~~~~~~~~~
<%@ Page Language="VB" Codebehing="Page.aspx.vb" AutoEventWiredUp=false %>
<%@ Register TagPrefix="Pagination" TagPrefix="Header" src="header.ascx" %>
<%@ Register TagPrefix="Pagination" TagPrefix="Footer" src="footer.ascx" %>
<%
Dim DEFINED_VAR
DEFINED_VAR = "Print this"
%>
<Pagination:Header id="header1" runat=server />
<Pagination:Footer id="footer1" runat=server />
Note: What I want to do is to pass the DEFINED_VAR in header.ascx file,
similar to OLD ASP scenario.
How can i achieve that in .NET
Your help is immediately required.
Consider the following ASP program.
`````````````
OLD ASP STYLE
`````````````
~~~~~~~~~~
header.inc
~~~~~~~~~~
<html>
<body>
<table .......>
<tr>
<td><%=DEFINED_VAR%></td> <!-- DEFINED VAR WILL BE DEFINED AT THE TOP
OF EACH PAGE -->
</tr>
</table>
~~~~~~~~~~
footer.inc
~~~~~~~~~~
</body>
</html>
~~~~~~~~~~
index.asp
~~~~~~~~~~
<%@ Language="VB" %>
<%
Dim DEFINED_VAR
DEFINED_VAR = "Print this"
%>
<!-- #include file="header.inc"-->
<!-- #include file="footer.inc"-->
`````````````
..NET STYLE
`````````````
~~~~~~~~~~
header.ascx
~~~~~~~~~~
<%@ Control language="VB" AutoEventWiredUp=False
Codebehind="HeaderControl.aspx.vb" %>
<html>
<body>
<table .......>
<tr>
<td><%=DEFINED_VAR%></td> <!-- It reports me an error at this point -->
</tr>
</table>
~~~~~~~~~~
footer.ascx
~~~~~~~~~~
<%@ Control language="VB" AutoEventWiredUp=False
Codebehind="FooterControl.aspx.vb" %>
</body>
</html>
~~~~~~~~~~
index.aspx
~~~~~~~~~~
<%@ Page Language="VB" Codebehing="Page.aspx.vb" AutoEventWiredUp=false %>
<%@ Register TagPrefix="Pagination" TagPrefix="Header" src="header.ascx" %>
<%@ Register TagPrefix="Pagination" TagPrefix="Footer" src="footer.ascx" %>
<%
Dim DEFINED_VAR
DEFINED_VAR = "Print this"
%>
<Pagination:Header id="header1" runat=server />
<Pagination:Footer id="footer1" runat=server />
Note: What I want to do is to pass the DEFINED_VAR in header.ascx file,
similar to OLD ASP scenario.
How can i achieve that in .NET
Your help is immediately required.