Free Support Forum - aspose.com

GridWeb - CustomCommandButton's images get broken after grid command

Hi,

I am reproducing the issue using a simple demo with the following GridWeb:

<acw:GridWeb ID=“GridWeb1” runat=“server” Width=“100%” Height=“100%” ShowLoading=“true” XhtmlMode=“true” OnCustomCommand=“GridWeb1_CustomCommand” PresetStyle=“Standard” EnableAJAX=“true” EnableAsync=“true” RenderHiddenRow=“true”>

<acw:CustomCommandButton Command=“MainMenu” ImageUrl=“Images/MainMenu.png”>
</acw:CustomCommandButton>

</acw:GridWeb>

It works perfectly while running on visual studio. However it gets a strange behavior when deployed.The CustomCommandButton’s image appears when the page first opens or when it is refreshed, but when I click on any of the command buttons the image gets broken.

If I look at the source I see that the path changed to ‘…/Images/MainMenu.png’.

I don’t have any code changing the Image path, but every time an action is performed over the gridweb the path changes to an nonexistent one.

Is there some configuration I am missing?

I appreciate any help you could provide.

Thanks.

@virginia.nascimento,
Thank you for your query.

Could you please share the compilable simple Visual Studio solution which can be used to reproduce the issue here. It will help us to reproduce the issue here and provide assistance accordingly.

GridWeb_13-Feb-2018.zip (5.2 MB)

Here, I attached the project. Thanks for the quick reply.

@virginia.nascimento,
Thank you for the sample solution. I am afraid that I could not run this project in my environment, however, the GridWeb project here works fine. Is it possible for you to download the sample solution and modify it to reproduce the issue here? If it is not feasible for you, please provide us with the steps to make this project run here to observe the issue. Also, share your environment details where this solution is working without errors.

Thanks for your reply.

I use Visual Studio 2017. I modified the sample project. However it is too big to attach here.
Is it possible for you to add the page I created to reproduce the problem in you running project? I used the folder Examples_GridWeb\CSharp:
TestProblemWebgrid.aspx.zip (1.2 KB)

I simply add a GridWeb and a CustomCommandButton with an image that already exists in the project. While running in Visual Studio it works fine.
Then I publish the website using the FileSystem method (with Precompile during publishing checked).

When I open the deployed page, it shows the images correctly.
image.png (3.6 KB)

However if I click one of the buttons or double click a cell, the images get broken.
image.png (4.6 KB)

Inspecting the page source I see that an extra ‘…/’ was added to the image url.
image.png (5.2 KB)

I wonder if there is some configuration I am missing.

Thanks for your help.

@virginia.nascimento,
Please spare us little time to analyze your issue. We will write back here soon to share our feedback.

@virginia.nascimento,
I have added the page into my project and tried the scenario through Visual Studio 2019 . This project was tested by IIS Express and no issue is observed. The same application is deployed on IIS using Visual Studio 2019 which also does not raise any problem in the custom button icon while clicking on multiple places in the grid.

I tried the same scenario by publishing the application to file system and then deploying it on IIS server. I am afraid that when I try to open your page in the browser, it is raising some error which was not faced while deploying it through Visual Studio 2019.

I need to dig out this issue, therefore, it is requested that you may upload the compilable solution to some public file sharing server and share the download link here. You may also publish the project and upload that folder also separately on file-sharing server and share the download link. We will download the solution and analyze it for our reference.

You may also try to deploy the solution on IIS server using Visual Studio 2019 and share the feedback.

Hi,

Thanks for the reply.

I used various projects and obtained the same result when deployed on my IIS, while on Visual Studio works well. I had issues with the acw_client_path too which worked on Visual Studio but not on my IIS.
So I’m assuming there is something wrongly configured on my IIS.

Anyway, I end up not using the Ajax mode on the WebGrid due to other issues with our project, so the problem stop happening.

Once again thank you for your help.

@virginia.nascimento,
Thank you for the feedback. Please feel free to write us back if you have any other query related to Aspose.Cells. We will be happy to provide you assistance at the earliest.