In this hint, I elaborates How to use SharePoint Images Mapped Folder to add an image to Visual WebPart in SharePoint by following the mentioned steps below:
- Open Visual Web Part Project > Solution Explorer.
- Right click on the project name > Add > “SharePoint Images Mapped Folder”
- An “Image” folder was added with a sub folder named as your project name.
- Inside the sub folder > Add your images.
- Double click on Visual web part page “ascx”.
- Drag and drop Image from SharePoint Images Mapped Folder – Sub Folder.
- Navigate to Source code.
To Add Image URL in CSS file inside SharePoint Visual Web Part check this article