0

I have inserted an Image viewer webpart in sharepoint page (say Page 1). Actually this page will be displayed by clickng on a Employee (link button) in onther page ( say Page 2) . From page 2 I can get Employee ID in querystring. So now I have to fill the image viewer webpart with an image based on the Employee ID. All the images stored in user profiles in sharepoint.

Can anybody give a solution how to pass parameter and get the imageurl from image viewer webpart?

karthik k
  • 3,751
  • 15
  • 54
  • 68

1 Answers1

1

This can be done by creating a custom webpart and setting the value of image URL based on the employee id. Get the employee ID:

QueryParameterValue = HttpContext.Current.Request.QueryString[0].ToString();

Create an object of imagewebpart:

protected Microsoft.SharePoint.WebPartPages.ImageWebPart myImageWebPart = new Microsoft.SharePoint.WebPartPages.ImageWebPart();

Set the URL value of the ImageWebPart here. Done

LPL
  • 16,827
  • 6
  • 51
  • 95
user903071
  • 11
  • 2