954,170 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How it is possible tu use a class that is in a new vb file??

I have generate a ASP.NET page with a Codebehind but i want to create a file with common method that i must make in many page of my website.
I create a new file class .vb, but how can I using the public function that I have insert in??
Thanks a lot for your help.

lorf14plus
Newbie Poster
20 posts since May 2005
Reputation Points: 10
Solved Threads: 1
 

Here is an example using a class called MyClass in Page1.aspx

In you class file:

Public Class MyClass
    Inherits System.Web.UI.Page


In your code behind page:

Public Class Page1
    Inherits MyClass


So, you are replacing "Inherits System.Web.UI.Page" in your codebehind pages with the name of your class.

-sypher

sypher
Light Poster
29 posts since May 2005
Reputation Points: 13
Solved Threads: 0
 

Thanks for you help but I don't know how it is possible to call the metod when I have defined the Inherits, can you post me an complete example??
I prove many time but I don't found an example to refer for resolve this problem.

Thanks a lot

lorf14plus
Newbie Poster
20 posts since May 2005
Reputation Points: 10
Solved Threads: 1
 

I found the correct way to call the method that is included with the inheriths.
Thanks a lot for your help.

:) :)

lorf14plus
Newbie Poster
20 posts since May 2005
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You