Where should I include a script for a view component?

前端 未结 5 1890
故里飘歌
故里飘歌 2021-02-20 04:26

I have tried adding a section script inside a view component\'s view.

@section scripts {
    

        
5条回答
  •  遥遥无期
    2021-02-20 04:48

    View component in ASP.NET Core acts like independent view with separated controller, so you can insert bellow tag above of your view component

    @{
    Layout = null;
    }
    

    after that insert bellow tag to use related script,for example:

    
    
    
    
    
     
    
    
    
    
    

提交回复
热议问题