Razor Web Application, displaying a razor page in a Kendo window

1 Answer 119 Views
Window
Keith
Top achievements
Rank 1
Keith asked on 12 Oct 2021, 06:45 PM

How do I code this for a razor web application. How do I code the content-url paramater? 

 

Here is an MVC example of displaying a page in a Kendo window: https://demos.telerik.com/aspnet-core/window/tag-helper 

@addTagHelper *, Kendo.Mvc

@{
    string[] actions = new string[] { "Close" };
}

<kendo-window name="window"
              title="Rams's Ten Principles of Good Design"
              draggable="true"
              resizable="true"
              width="600"
              on-close="onClose"
              content-url="@Url.Action("AjaxContent_TagHelper", "Window")"
              actions="actions">
    <content>
        loading user info...
    </content>
    <popup-animation enabled="false" />
</kendo-window>

<span id="undo" style="display:none" class="k-button">Click here to open the window.</span>

<script>
    function onClose() {
        $("#undo").show();
    }

    $(document).ready(function() {
        $("#undo").bind("click", function() {
                $("#window").data("kendoWindow").open();
                $("#undo").hide();
            });
    });
</script>

 

 

Keith
Top achievements
Rank 1
commented on 15 Oct 2021, 11:37 AM

I got it figured out. But thanks for your help. 

1 Answer, 1 is accepted

Sort by
0
Accepted
Stoyan
Telerik team
answered on 15 Oct 2021, 11:11 AM | edited on 15 Oct 2021, 04:05 PM

Hi Keith,

Razor Pages projects do not have Controllers and Actions, instead they have Pages and Handlers. To set up the content of the Window Component to be populated by a Handler response use the following syntax:

content-url='@Url("/Window?handler=AjaxContent_TagHelper")'
Another approach you can use is:
content-url='@Url.Page("Window", "AjaxContent_TagHelper")'
suggested in the Razor Pages generate dynamic url StackOverflow thread.

Please give the above a try and let me know how it works for you. Thank you.

 

Regards,
Stoyan
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
Tags
Window
Asked by
Keith
Top achievements
Rank 1
Answers by
Stoyan
Telerik team
Share this question
or