Add Image to Visual WebPart In SharePoint

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.

VS Solution Explorer

  • Right click on the project name > Add > “SharePoint  Images Mapped Folder”

SharePoint Images Mapped Folder

  • An “Image” folder was added with a sub folder named as your project name.

Image Mapped Folder Added

  • Inside the sub folder > Add your images.

Add exsisting Image

  • Double click on Visual web part page “ascx”.

Open Ascx

  • Drag and drop Image from SharePoint  Images Mapped Folder – Sub Folder.

Drag image to webpart.png

  • Navigate to Source code.

Image code behind

To Add Image URL in CSS file inside SharePoint Visual Web Part check this article

Enjoy 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s