Accessing VB.Net class in App_Code from C# code behind

Last Reply 3 months ago By pandeyism

Posted 3 months ago


 In my App_Code I have made class file in .vb. Now need to access that file class in c# code behind. 

The class file is inaccessible in c# code behind file.

How should I do that.

Posted 3 months ago

Hi Sumeet,

Please refer below sample.

Vb class can  access in C# code behind, refer below sample.


protected void Page_Load(object sender, EventArgs e)
    Customer cust = new Customer();
    Response.Write("Name is: " + cust.GetFirstName() + " " + cust.GetLastName());


Public Function GetFirstName() As String
    Return "Mudassar"
End Function

Public Function GetLastName() As String
    Return "Khan"
End Function


Name is: Mudassar Khan