Get current controller in view

后端 未结 7 852
北荒
北荒 2020-12-04 11:55

I have a View - _Edit which lives in News M/V/C.

I reuse the V/M via the CategoryController as:

r         


        
相关标签:
7条回答
  • 2020-12-04 12:48

    Just use:

    ViewContext.Controller.GetType().Name
    

    This will give you the whole Controller's Name

    0 讨论(0)
提交回复
热议问题