logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
judy at Web2Market  
#1 Posted : Wednesday, June 5, 2019 8:38:53 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
I can't figure out why this happens, but below is
My products have all three images entered into the database. When I go to the images tab in the admin, I get this error. I can't debug enough to figure out the issue.
Quote:

Value cannot be null or empty.
Parameter name: contentPath
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Value cannot be null or empty.
Parameter name: contentPath

Source Error:


Line 69: {
Line 70: <div class="col-lg-5 over" id="imageContainer"><img class="img-thumbnail img-responsive" id="image" src="@Url.Content(Model.ImagePreviewUrl)" data-unresolved="@Model.ImagePreviewUrl" /></div>
Line 71: <div class="col-lg-4 over"><img class="img-thumbnail img-responsive" id="thumbnail" src="@Url.Content(Model.ThumbnailPreviewUrl)" data-unresolved="@Model.ThumbnailPreviewUrl" /></div>
Line 72: <div class="col-lg-3 over"><img class="img-thumbnail img-responsive" id="icon" src="@Url.Content(Model.IconPreviewUrl)" data-unresolved="@Model.IconPreviewUrl" /></div>
Line 73: }

Source File: E:\Able9B5338Test3\Website\Areas\Admin\Views\Product\ProductImage.cshtml Line: 71

Stack Trace:


[ArgumentException: Value cannot be null or empty.
Parameter name: contentPath]
System.Web.Mvc.UrlHelper.GenerateContentUrl(String contentPath, HttpContextBase httpContext) +166
ASP._Page_Areas_Admin_Views_Product_ProductImage_cshtml.Execute() in E:\Able9B5338Test3\Website\Areas\Admin\Views\Product\ProductImage.cshtml:71


Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

MikeR  
#2 Posted : Wednesday, June 5, 2019 8:46:18 AM(UTC)
MikeR

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, System, Admin
Joined: 10/18/2018(UTC)
Posts: 183

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
Hi Judy,

Were the images added via the admin interface or directly to the database?

You said 'My products have all three images entered into the database.'

So it sounded like you might have added them via the db.
Thank you for your support!
Mike Randolph
AbleCommerce.com
pankildesai198826049399  
#3 Posted : Monday, June 10, 2019 2:36:24 PM(UTC)
pankildesai198826049399

Rank: Newbie

Groups: Authorized User, Developers
Joined: 6/10/2019(UTC)
Posts: 1

Hello Judy,

This is the code issue on the View Page. It is because either one of the image URL is Null and that is causing the error over here.
Put the below line of code in the place of line 69 to 73. By putting this you can open a page without error.



if (Model.ImagePreviewVisible)
{
<div class="col-lg-5 over" id="imageContainer"><img class="img-thumbnail img-responsive" id="image" src="@Url.Content(Model.ImagePreviewUrl)" data-unresolved="@Model.ImagePreviewUrl" /></div>
}
else
{
<div class="col-lg-5 over" id="imageContainer"><img class="img-thumbnail img-responsive" id="image" src="" /></div>
}
if (Model.ThumbnailPreviewVisible)
{
<div class="col-lg-4 over"><img class="img-thumbnail img-responsive" id="thumbnail" src="@Url.Content(Model.ThumbnailPreviewUrl)" data-unresolved="@Model.ThumbnailPreviewUrl" /></div>
}
else
{
<div class="col-lg-4 over"><img class="img-thumbnail img-responsive" id="thumbnail" src="" /></div>
}

if (Model.IconPreviewVisible)
{
<div class="col-lg-3 over"><img class="img-thumbnail img-responsive" id="icon" src="@Url.Content(Model.IconPreviewUrl)" data-unresolved="@Model.IconPreviewUrl" /></div>
}
else
{
<div class="col-lg-3 over"><img class="img-thumbnail img-responsive" id="icon" src="" /></div>
}
judy at Web2Market  
#4 Posted : Tuesday, June 11, 2019 6:07:15 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
pankildesai198826049399- thanks for the code.
Mike- I added them directly into the database.
Users browsing this topic
Guest (6)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.