Vahid Amiri
Vahid Amiri

Reputation: 11117

Can't use .cs file in a view in already compiled app

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

Answers (1)

wojciech_rak
wojciech_rak

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.

  1. 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.

  2. Add @using in your View.

  3. Use the class and methods you want.

Upvotes: 1

Related Questions