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.

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.


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

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

:) :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.