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
|
|
|
|
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. |
|
|
|
|
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> }
|
|
|
|
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.
|
|
|
|
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.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close