Here are some details about our development environment:
-DevExpress 20.2.3 ( we are using DevExtreme )
-Microsoft Visual Studio Enterprise 2019 (Version 16.4.6)
-ASP.NET Core 3.1.0
-AspNetCore.Mvc 3.1.0.0
If I implement the following then document object is Not defined:
@using (Html.DevExtreme().NamedTemplate("upload-popup-template")) {
@await Html.PartialAsync("UpldPopupContentTmpltPartial", new HomeUpldPopupContentTmpltPartialViewModel()
{ SelectedUploadDataType =
document.getElementById('HiddenSelectedUploadDataType').Value });
}
Even if I try to embed within Script javascript tags, it still states that document object is undefined
@using (Html.DevExtreme().NamedTemplate("upload-popup-template")) {
<script type="text/javascript">
@await Html.PartialAsync("UpldPopupContentTmpltPartial", new HomeUpldPopupContentTmpltPartialViewModel()
{ SelectedUploadDataType =
document.getElementById('HiddenSelectedUploadDataType').Value });
</script> }
Could some please modify the following Razor/Javascript code in such a way that the JavaScript gets executed within the @Html.Raw ?
@using (Html.DevExtreme().NamedTemplate("upload-popup-template")) {
@await Html.PartialAsync("UpldPopupContentTmpltPartial", new
HomeUpldPopupContentTmpltPartialViewModel()
{ SelectedUploadDataType =
@Html.Raw("document.getElementById('HiddenSelectedUploadDataType').Value").ToString()
}); }

