dnnsoftware / Dnn.Platform

DNN (formerly DotNetNuke) is the leading open source web content management platform (CMS) in the Microsoft ecosystem.
https://dnncommunity.org/
MIT License
1.03k stars 749 forks source link

MVC DNN API Url.Action returns wrong url #5458

Open mikecy opened 1 year ago

mikecy commented 1 year ago

Description of bug

On an MVC module when you load partialview from javascript the Url.Action returns wrong url. Instead of the current page it changes the Url path to the homepage with the parameters. For some reason in the ModuleContext is not passed correctly

Steps to reproduce

List the precise steps to reproduce the bug: var url = dnn.getVar("sf_siteRoot", "/") + "DesktopModules/MVC/ClusterManager/Students/PartialStudents"; $.ajax({ type: "GET", cache: false, url: url, data: { CompanyID:@Model.CompanyId, pageSize: $("#pageSize").val(), pageIndex: pindex, SchoolYearID: $("#schoolyear").val() ,ItemID: @Model.ItemId, searchTerm: $("#txtSearch").val() }, headers: { "ModuleId": @Dnn.ModuleContext.ModuleId, "TabId": @Dnn.ModuleContext.TabId, "RequestVerificationToken": $("input[name='__RequestVerificationToken']").val() } }) .done(function (data) { model.empty().append(data); });

Affected version

Affected browser

valadas commented 1 year ago

I don't use MVC much, can anyone help on this one ?

stale[bot] commented 1 year ago

We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically. If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!