Here are some details about our development environment:
DevExpress 20.1.7 ( we are using DevExtreme )
Microsoft Visual Studio Enterprise 2019 (Version 16.4.6)
ASP.NET Core 3.1.0
I cannot do the following with JavaScript because the document JavaScript object is undefined inside the following razor code.
@await Html.PartialAsync("UpldPopupContentTmpltPartial", new ViewDataDictionary(ViewData) { { "BookId", document.getElementById("HiddenSelectedUploadDataType").Value } });
I am seeking a detailed explanation with sample code that will show me how I can pass the document.getElementById("HiddenSelectedUploadDataType").Value to the aforementioned partial view.
Updates
@yiyi-you Thank you for your detailed explanation within your answer.
However, I used the following line of code with @Html.Raw, but even though I'm practical, I still prefer proper implementation practices especially when it makes it easier for code reuse in the future and/or security and/or clarity:
@await Html.PartialAsync("UpldPopupContentTmpltPartial", new ViewDataDictionary(ViewData) { { "BookId", @Html.Raw("document.getElementById('HiddenSelectedUploadDataType').Value")} });
Is the aforementioned code adhering to proper implementation practices?

