The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Hi there,


I am using the Datagird control on a website. There you can select some rows in the grid and then you can press a button, that posts some Data to my code behind. That post returns a FileStreamResult. ​that works 100% correct on my development environment, but when I publish that code it can ​happen, that I receive the message

"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." on a blank page.
It looks like it is not deterministic.



Thanks i advance

Here is some code:

 <!-- Syncfusion Essential JS 2 Styles -->

    <link rel="stylesheet" rel='nofollow' href="https://cdn.syncfusion.com/ej2/material.css" />

    <link rel="stylesheet" rel='nofollow' href="https://cdn.syncfusion.com/ej2/ej2-buttons/styles/material.css" />


    <!-- Syncfusion Essential JS 2 Scripts -->

    <script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js" charset="utf-8"></script>



<ejs-grid id="Grid" rowSelected="RowSelected" rowDeselected="RowDeselected" allowSorting="true" locale="de-DE" allowExcelExport="true" allowPaging="true" height="350px"

              toolbar="@(new List<string>(){"Add","Edit","Delete","Update","Cancel","Print","ExcelExport"})">


        <e-data-manager json="obj" updateurl="ManageItems/Update" inserturl="ManageItems/Insert" removeurl="ManageItems/Delete" adaptor="RemoteSaveAdaptor"

                        headers='new Object[] { new Dictionary<string, object>() { { "RequestVerificationToken",token } } }'></e-data-manager>


        <e-grid-selectionsettings type="Multiple" persistSelection="true"></e-grid-selectionsettings>


        <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true" mode="Normal" showConfirmDialog="true" showDeleteConfirmDialog="true"></e-grid-editSettings>


        <e-grid-columns>

            <e-grid-column type="checkbox" width="50" headerText="Alle"></e-grid-column>

            <e-grid-column field="Id" isPrimaryKey="true" visible="false" headertext="Id" headerTextAlign="Center"></e-grid-column>

            <e-grid-column field="MarketUserId" visible="false" defaultValue=@ViewData["MarketUserId"]></e-grid-column>

            <e-grid-column field="MarketId" visible="false" defaultValue=@ViewData["MarketId"]></e-grid-column>

            <e-grid-column field="DataArea" visible="false" defaultValue=@ViewData["DataArea"]></e-grid-column>

            <e-grid-column field="Description" headertext="Beschreibung" headerTextAlign="Center" validationRules='new Dictionary<string, object>() { { "required", true } }'></e-grid-column>

            <e-grid-column field="ExtendedDescription" headertext="Erw. Beschr." headerTextAlign="Center"></e-grid-column>

            <e-grid-column field="Color" headertext="Farbe" headerTextAlign="Center"></e-grid-column>

            <e-grid-column field="Size" headertext="Größe" headerTextAlign="Center"></e-grid-column>

            <e-grid-column field="Price" headertext="Preis" type="number" format="C2" editType="numericEdit" edit="new { @params = new {step=0.1, min=0.1}}" headerTextAlign="Right" textAlign="Right" defaultValue="0"

                           validationRules='new Dictionary<string, object>() { { "required", true } ,{ "min", 0 } }'>

            </e-grid-column>

            <e-grid-column field="Quantity" headertext="Menge" type="number" editType="numericedit" headerTextAlign="Right" textAlign="Right" defaultValue="1"

                           validationRules='new Dictionary<string, object>() { { "required", true },{ "min", 1 } }'>

            </e-grid-column>

        </e-grid-columns>

    </ejs-grid>


 function RowSelected(args) {


        var erg = updateMsg();


        if ((erg.count <= 63 || "@ViewData["UserRole"]?.ToString()" != "seller") ) {


            $("#print").removeAttr("disabled");

            $("#print").attr("formaction", "ManageItems/Print?req=" + erg.rows + ";" + "@ViewData["DataArea"]" + ";" + "@ViewData["MarketId"]");

        }

    }



    function updateMsg() {


        var grid = document.getElementsByClassName('e-grid')[0].ej2_instances[0];

        var selectedRecords = grid.getSelectedRecords();


        var rows = "";

        var count = 0;

        for (var i = 0; i < selectedRecords.length; i++) {

            rows += selectedRecords[i]["Id"] + ","

            count += selectedRecords[i]["Quantity"]

        }


        var msg = document.getElementById("count");


        if("@ViewData["UserRole"].ToString()" === "seller")

            msg.innerHTML = "Nur ausgewählte Artikel werden gedruckt (<b>" + count + "</b> von 63)";

        else

            msg.innerHTML = "Nur ausgewählte Artikel werden gedruckt (" + count + ")";



        if (count === 0 || (count > 63 && "@ViewData["UserRole"]?.ToString()" === "seller"))

            $("#print").attr("disabled","");


        var erg = {

            count: count,

            rows: rows

        };



        return erg;

    }


and the code behind:


 public async Task<IActionResult> OnPostPrintAsync(string req,string returnUrl = null)

        {

            _user = await _userManager.GetUserAsync(User);


            var reqArray = req.Split(';');


            if (reqArray.Length == 3)

                return CreateItemsPDF(reqArray[0], Guid.Parse(reqArray[1]), Guid.Parse(reqArray[2])); // returns a FileStreamResult

            else

                return null;


        }



5 Replies

PS Pavithra Subramaniyam Syncfusion Team February 8, 2022 12:40 PM UTC

Hi Martin, 
 
From your query we understand that you are facing issue only while publishing the EJ2 Grid component you are facing the issue. We have tried to reproduce the issue at our side, but it is working fine with given details. So, to validate further, could you please share the below details that will be helpful for us to provide a better solution as early as possible. 
 
  1. Share the Syncfusion dll version you are using
  2. Share the code where you are referring the ej2.min.js file and ej2.min.css file
 
Regards, 
Pavithra S 



MS Martin Stein February 9, 2022 04:23 AM UTC

Hi ,


the version is19.4.0.48.

the code where I reference to EJ2 is located in my shared /_Layout.cshtml:


 <!-- Syncfusion Essential JS 2 Styles -->

    <link rel="stylesheet" rel='nofollow' rel='nofollow' href="https://cdn.syncfusion.com/ej2/material.css" />

    <link rel="stylesheet" rel='nofollow' rel='nofollow' href="https://cdn.syncfusion.com/ej2/ej2-buttons/styles/material.css" />


    <!-- Syncfusion Essential JS 2 Scripts -->

    <script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js" charset="utf-8"></script>



kind regards,


Martin



JC Joseph Christ Nithin Issack Syncfusion Team February 10, 2022 05:34 PM UTC

Hi Martin, 

  Thanks for your update. 

  Before proceeding to the solution we would like you to provide further details so that we will be able to validate further. 

  • Share the link of the published Sample and provide access to us for validation.
  • Share the video demonstration of the issue you are facing like screenshot or video demonstration.

Please get back to us for further details. 

Regards, 
Joseph I. 



MS Martin Stein February 10, 2022 07:34 PM UTC

Hi,

find the link to my website and the desired video.


Mein Secondhand Markt - Mein Secondhand Markt (secondhandweb.azurewebsites.net)


The user is 100001 and the pwd is Eli6has9$.


Kind regards,
Martin


Attachment: secondhand_28a5fd93.zip


JC Joseph Christ Nithin Issack Syncfusion Team February 11, 2022 02:05 PM UTC

Hi Martin, 

  Thanks for your update. 

   On inspecting the sample provided, we could see that the issue is not related to theEJ2 Grid component. We can see that when clicking the `print` button you are sending a request to the server, which is returning a 404 error. Please refer the below screenshot. 

 

We have also checked that when we are selecting a single row and clicking the button the request is redirected properly and  the pdf is downloaded. Hence, you have to handle this from your server side method where you are performing the redirection. 

Please get back to us for further details. 

Regards, 
Joseph I. 


Loader.
Up arrow icon