Access a Class properties/methods from a .aspx file ?????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have written a class (Vb.net) which supposed to write out page title, img
URLs and other stuff.

I can access the class methods and properties easily through the .vb page
But how do I change the things on the .aspx file via the class eg



--------------- .vb file --------------

Dim pageTitle as string = ""
Dim objSiteStyle As New SStyle()
objSiteStyle.NewStyle()
pageTitle = objSiteStyle.pageTitle
objSiteStyle.Nothing


--------------- .aspx file --------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>[WRITE OUT THIS VIA THE CALSS pageTitle ]</title>
'<<<<<<<<<<<<<HELP
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
</form>
</body>
</HTML>
 
Thanx mate

vQuick reply
That took me ages to work out



abacnet said:
1-First of all your class must be accessible in the code behind of the ..aspx
page
2-Use a page level protected variable in your code behind .vb page
(protected mstrTitle as string="")
3-In the page load, or anywhere that you find suited for your case, add
.....your working vb code and don't forget to assign value to the title
string
mstrTitle = objSiteStyle.pageTitle
4-In the HTML part of your .aspx page do inherit the string
<title><%=mstrTitle%></title>


Hi
I have written a class (Vb.net) which supposed to write out page title, img
URLs and other stuff.

I can access the class methods and properties easily through the .vb page
But how do I change the things on the .aspx file via the class eg



--------------- .vb file --------------

Dim pageTitle as string = ""
Dim objSiteStyle As New SStyle()
objSiteStyle.NewStyle()
pageTitle = objSiteStyle.pageTitle
objSiteStyle.Nothing


--------------- .aspx file --------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>[WRITE OUT THIS VIA THE CALSS pageTitle ]</title>
'<<<<<<<<<<<<<HELP
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
</form>
</body>
</HTML>
 
Back
Top