Add button on window (custom command)

2 posts, 0 answers
  1. alveiro
    alveiro avatar
    4 posts
    Member since:
    Apr 2020

    Posted 06 Aug 2020 Link to this post



    I'm doing this example:

    I would like to add a button to the view, the button should redirect to a controller action with a parameter.
    attached image

    How could I do it?


  2. Petar
    Petar avatar
    459 posts

    Posted 11 Aug 2020 Link to this post

    Hi Alveiro,

    Attached to my reply, you will find a runnable example of how the targeted functionality in the popup Window can be implemented. 

    Here are the modifications applied in the Window's template. In the below code, the yellow line defines the additional button added to the popup.

    <script type="text/x-kendo-template" id="template">
        <div id="details-container">
            <h4>#= OrderID # #= OrderDate #</h4>
            <em>#= Freight #</em>
                <dt>City: #= ShipCity #</dt>
                <dt>Name: #= ShipName #</dt>
            <a class="k-button" href="/Grid/LoadPage?customParam=#= ShipCity #">Go To controller and load View</a>

    When the button is clicked, it will send the "customParam" to the LaodPage controller that is defined as follows:

    public ActionResult LoadPage(string customParam) {
        return View("LoadView", new LoadViewModel { CustomParam = customParam });

    The above controller will load the LoadView partial view.

    I hope the provided example will help you implement the targeted functionality in the application you are working on.

    Progress Telerik

Back to Top