This is a migrated thread and some comments may be shown as answers.
Custom HtmlHelper
1 Answer 20 Views
This is a migrated thread and some comments may be shown as answers.
Denis
Top achievements
Rank 1
Denis asked on 26 Jul 2018, 02:21 PM

Hello everybody!

I would like to make my helper. In UI for MVC It looked like this

public static WindowBuilder KendoWindow(this HtmlHelper helper, string name, string titleResKey, string dataRequestUrl = null, int? minWidth = null, int? minHeight = null, int? maxWidth = null, int? maxHeight = null, string onRefreshEvent = null)
        {
            var attrib = new Dictionary<string, object>();

            var window = helper.Kendo()
            .Window()
            .Name(name)
            .Title(titleResKey)
            .Draggable()
            .Actions(action => action.Close())
            .Animation(true)
            .Events(x => x.Activate("onKendoWindowActivate").Close("onKendoWindowClose"))
            .Modal(true)
            .Visible(false).AutoFocus(true);

return window;

}

But in the version for Net Core I do not have a reference helper.Kendo()

How can I do this now? Thank you

 

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 31 Jul 2018, 08:28 AM
Hello Denis,

Try using the WindowBuilder as follows:
using Kendo.Mvc.UI.Fluent;
 
namespace TelerikAspNetCoreAppWindow
{
    public static class CustomHtmlHelperExtensions
    {
        public static WindowBuilder MyKendoWindow(this WindowBuilder helper, string name, string titleResKey,
            string dataRequestUrl = null, int? minWidth = null, int? minHeight = null, int? maxWidth = null,
            int? maxHeight = null, string onRefreshEvent = null)      
        {
            return helper
                .Name(name)
                .Title(titleResKey)
                .Draggable()
                .Actions(action => action.Close())
                .Animation(true)
                .Events(x => x.Activate("onKendoWindowActivate").Close("onKendoWindowClose"))
                .Modal(true)
                .Visible(false).AutoFocus(true);
        }
    }
}

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Asked by
Denis
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or