Working with Image viewer webpart in sharepoint 2010
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?
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
精彩评论