asp.net mvc - Namespace in view

前端 未结 4 1184
失恋的感觉
失恋的感觉 2021-02-19 02:52

I place using namespace in a view code behind but i can\'t call any class of this name space in aspx.

In codebehind:

using MVCTest.Controller;

4条回答
  •  无人共我
    2021-02-19 03:53

    Suppose this is your .Cs file say

    namespace MVCTest.Controller {

    public class Utility
    
    { 
       public static void func1()
       {} 
    }
    

    }

    Try calling the function by : Utility.func1()

提交回复
热议问题