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

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

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

    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>





    Guest

  2. Similar Questions and Discussions

    1. Get Class from Aspx-File
      Hi, Is it possible to get the "ClassType" from a Filename to a .aspx file? I would like to access a class from an another page, knowing the...
    2. Screen, Form &amp; Slide Class Methods/Properties
      Help All I'm trying to do is get the name of the current screen. I modified code that I found from a Macromedia architect in these forums...
    3. #26350 [NEW]: Inherited methods can't access private methods
      From: forseti at oak dot rpg dot pl Operating system: Windows 98 SE PHP version: 5.0.0b2 (beta2) PHP Bug Type: Zend Engine 2...
    4. Instance- and class-variables (was mixing in class methods)
      Hi -- On Thu, 2 Oct 2003, Gavin Sinclair wrote: Ummm, what array? :-) I think you'd need something like: class Project class << self...
    5. how to add aspx and the class file separately in VS.NET?
      I'm looking at the source code of the ASP.NET forum sample application. It has the "code-behind" classes compiled into a separate DLL, totally...
  3. #2

    Default Re: Access a Class properties/methods from a .aspx file ?????

    Thanx mate

    vQuick reply
    That took me ages to work out



    "abacnet" <abacnet@hotmail.com> wrote in message
    news:ukwOM3hVDHA.624@TK2MSFTNGP10.phx.gbl...
    > 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>
    >
    >
    > <skynet@system-gone-soft.com> wrote in message
    > news:hBBVa.2175$Id1.229849@newsfep2-win.server.ntli.net...
    > > 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>
    > >
    > >
    > >
    > >
    > >
    >
    >

    sky Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139