web-parts

Customizing Web Parts - hiding prop in edit mode?

时光总嘲笑我的痴心妄想 提交于 2019-12-06 10:43:55
问题 Update: private string _catalogIconImageUrl = "http://hostname/images/favicon.ico"; [WebBrowsableAttribute(false), Category("HIDDEN"), Personalizable(PersonalizationScope.User), WebDisplayName("Catalog Icon Image url"), WebDescription("Something")] public string CatalogIconImageUrl { get { return _catalogIconImageUrl; } set { _catalogIconImageUrl = value; } } with the above code, it does not show the image and also when i click on edit the webpart i still able to see the catalogIconImageUrl

asp.net cache multithreading locks webparts

跟風遠走 提交于 2019-12-06 07:51:06
I have following scenario: Lets say we have two different webparts operating on the same data - one is a pie chart, another is a data table. in their Page_Load they asynchronously load data from the database and when loaded place it in application cache for further use or use by other web parts. So each o the web parts has code similar to this: protected void Page_Load(object sender, EventArgs e) { if (Cache["dtMine" + "_" + Session["UserID"].ToString()]==null) { ... Page.RegisterAsyncTask(new PageAsyncTask( new BeginEventHandler(BeginGetByUserID), new EndEventHandler(EndGetByUserID), null,

How to display an image in a SharePoint 2010 Web Part

流过昼夜 提交于 2019-12-06 00:52:43
问题 I would like to know how to display a local image in my SharePoint 2010 Web Part. I don't really know which url to write in the css. 回答1: Add SharePoint "Images" mapped folder to the project in Visual Studio. Create a WEB-PART-NAME folder inside (to keep related images together and not overwrite some other image by accident). Place the image in this folder. Use the following URL: /_layouts/images/WEB-PART-NAME/IMAGE-FILENAME.png 来源: https://stackoverflow.com/questions/5121775/how-to-display

How to programmatically update content in a SharePoint Web Part?

风流意气都作罢 提交于 2019-12-05 23:24:00
问题 Does anybody know how to programmatically update the content of any of the standard SharePoint v3 Web Parts? As an example, put a Link Summary Web Part on a page. Add some links to it. Now, how can I update this information using the WSS API? I have not found any direct way to do this, my only idea so far is to export the Web Part, (then delete it), modify the generated XML, and import it back. But surely, there must be an easier way? 回答1: You can use the SPLimitedWebPartManager class to

What are some good techniques for performance testing SharePoint web parts and controls?

烈酒焚心 提交于 2019-12-05 20:35:15
This is a question about performance testing specific to SharePoint web parts and controls (although standard ASP.NET methods would be applicable as well). I'm wondering what are some good techniques, considering factors such as: caching (what and when should you cache?) load balanced servers (storing state) interaction with other parts of the page (e.g. multiple JavaScript execution) measuring CPU usage for a particular control rendered page size I recommend Visual Studio Test Suite 2008 with SP1. We have used a test agent on our indexing server with the test controller running on the

Sharepoint 2010 register control as safe through wsp

人走茶凉 提交于 2019-12-05 19:40:29
I created a "Hello World" Sharepoint 2010 solution using VS2010. It contains just a feature, and a webpart containing a label. I registered the webpart as a safe control in the "Properties" window of the webpart, in VS2010. When I deploy my solution to my local server, everything works great! I can add the webpart to a page, and in the web.config file my control is added to the SafeControls list. When I install the same solution on a different server, I can see the webpart in the list of available webparts, but when I try to add it to the page, it tells me that it's not registered as safe.

How to add a web part page to a site definition?

旧街凉风 提交于 2019-12-05 19:22:08
I have to create a site definition for a client that must contain pre-defined web part pages. I can create the web part pages but am at a loss when it comes to attaching them to the site on creation. I know web part pages created through SharePoint are stored in a Document Library. Do I need to pre-populate a "Web Part Pages" document library and add the needed navigation to these files? If so, how do I go about adding the needed aspx files? Finally, are there any caveats that I should be aware of for configuring the custom web part page in onet? You can follow this methodology which uses

ASP.NET - Add Event Handler to LinkButton inside of Repeater in a RenderContent call

风格不统一 提交于 2019-12-05 17:32:28
I've got a Sharepoint WebPart which loads a custom User Control. The user control contains a Repeater which in turn contains several LinkButtons. In the RenderContent call in the Webpart I've got some code to add event handlers: ArrayList nextPages = new ArrayList(); //populate nextPages .... AfterPageRepeater.DataSource = nextPages; AfterPageRepeater.DataBind(); foreach (Control oRepeaterControl in AfterPageRepeater.Controls) { if (oRepeaterControl is RepeaterItem) { if (oRepeaterControl.HasControls()) { foreach (Control oControl in oRepeaterControl.Controls) { if (oControl is LinkButton) { (

How to open URL in SSRS report in webpart to new window

。_饼干妹妹 提交于 2019-12-05 09:12:06
I have created a report that I will embed in Sharepoint 2007 via a webpart using a report viewer. This works well and looks rather nice, however in the report I have a text field whose action is "Go To URL". When I click on the link within the webpart the link goes to the URL but it opens the URL within the webpart. Kind of ugly. There doesnt seem to be any additional capabilities/properties of the text box in the report other than setting the URL. How can I make the link/webpart open the URL in a new tab or window? Other than telling the user to right click the link and "Open in a new tab"...

Add web part to sharepoint page in aspx markup

三世轮回 提交于 2019-12-05 07:04:09
问题 I have an aspx page that get copied in the layouts directory of a Project Server instalation. The aspx is a web part page that has a web part zone. How can I add a web part in the markup of the page, within the web part zone? 回答1: You cannot have customizable Web Part pages in the layouts directory! This is only supported on Web Part pages stored in a document library or other folder in an SPWeb, i.e. ASPX files that you can get an SPFile reference to. Web Parts on ASPX pages in the layouts