Include script once and only once in a custom Editor

前端 未结 3 1263

So I\'m trying to create a custom editor so that for a DataType of \"Duration\" a textbox appears with a masked format of HH:MM:SS.

I\'ve created a very

3条回答
  •  执笔经年
    2020-12-18 01:22

    Well, you can do following:

    Add @RenderSection("MaskedInput", false) to your master layout. That'l render

    @section MaskedInput{}
    

    on each page that has that section;

    On a page you need to add maskedInput.js you put:

    @section MaskedInput
    {
        @*Include scripts, styles or whatever you need here*@
    }
    

提交回复
热议问题