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

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>
 
S

sky

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top