Reputation: 11117
I have a compiled app and just want to include a class in one of the views and use its methods.
This app is already compiled and I don't have access to its source. I included my class in Views folder, gave it a namespace and then tried to include it by @using my.namespace.here;
but it's not working.
So how do you include a .cs file in a view?
Upvotes: 2
Views: 69
Reputation: 2346
You probably want to use an external piece of code, in a DLL library. It that's true, you should do the following.
Add a reference: Expand your project, right click on references, then Add reference. In an opened window click Browse and select DLL you want to use. Now you should see it when you expand References in solution explorer.
Add @using
in your View.
Use the class and methods you want.
Upvotes: 1