web-parts

How to display XML returned by SharePoint for web parts?

こ雲淡風輕ζ 提交于 2019-12-08 12:37:19
问题 Lately I've been doing a lot of custom styling in SharePoint by modifying the XSL used to display various web parts. Knowing what the actual XML looks like, including which elements have actual values, really helps when working in the XSL. I've discovered a way to show this XML when using Ontolica web parts, but not when I'm using the default web parts included with SharePoint. So, is there a way to do this, either programmatically or simply by adding a parameter to the URL? I could really

Add web part programmatically to a Sharepoint Page and save values into the web part personalization store

只愿长相守 提交于 2019-12-08 09:00:02
问题 In my project I programmatically create a web part page and add a web part to it using SPLimitedWebPartManager. I also want to set some properties for the web part and save it into the web part personalization scope. How can I access the personalization store for the web part. 回答1: Use the method SaveChanges on SPLimitedWebPartManager after change your properties to set them. 回答2: Please refer following post for adding web part programmatically: http://www.etechplanet.com/post/2009/03/18

Pass Querystring parameter from SharePoint to Java Applet webpart

旧街凉风 提交于 2019-12-08 05:01:14
问题 I have a SharePoint webpart page, with a parameter in the page Querystring (in the URL), and I also have a Page Viewer webpart (which effectively IFRAME's the specified webpage), which shows a Java applet. Is there any way I can get the parameter in the SharePoint Querystring to be recieved by the Java Applet ? The reason for doing a Java applet in a webpart is to allow a file to be dragged and dropped onto the Java applet, and the parameter shows where the file would be saved in the

asp.net cache multithreading locks webparts

限于喜欢 提交于 2019-12-07 22:01:37
问题 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

Get value from programmatically created TextBox in C#

送分小仙女□ 提交于 2019-12-07 18:43:58
问题 I got this itching problem and I cant get the code to work How can i read the value from the TextBox when the form is posted? Some code... protected override void CreateChildControls() { base.CreateChildControls(); TextBox queryBox = new TextBox(); queryBox.ID = "querybox"; queryBox.ToolTip = "Enter your query here and press submit"; Controls.Add(queryBox); Button queryButton = new Button(); queryButton.UseSubmitBehavior = false; queryButton.ID = "querybutton"; Controls.Add(queryButton); if

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

爷,独闯天下 提交于 2019-12-07 15:05:52
问题 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 回答1: I recommend Visual Studio Test Suite

Properly implement a webpart with postback?

别等时光非礼了梦想. 提交于 2019-12-07 04:39:16
问题 What I'm trying to do is to create a webpart that has a textbox where you can set the value of a literal (h2) on the webpart and a "save" button that posts back and then sets the literal accordingly. This works with one huge caveat; when the page loads after the postback the literal has not been changed. However if I log what is actually set in the literal it has the new value. Also if I reload the page again (F5) it displays correctly. At first I figured it must be ViewState, so I disabled

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

微笑、不失礼 提交于 2019-12-07 03:58:41
问题 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

Hiding default properties for a custom visual web part

天大地大妈咪最大 提交于 2019-12-06 13:20:27
问题 Is there a way of hiding Common properties of Web Parts? The Layout or appearance section for example. I have created a new visual web part and I wan't to make it very easy to edit for the administrators and they don't need the standard layout / appearance settings when they go to 'edit web part' Any ideas how to hide the base properties from the edit panel? Been searching all over but can't see anything in the documentation. 回答1: Here's one way to achieve this. In your EditorPart, mark the

Get value from programmatically created TextBox in C#

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 11:55:20
I got this itching problem and I cant get the code to work How can i read the value from the TextBox when the form is posted? Some code... protected override void CreateChildControls() { base.CreateChildControls(); TextBox queryBox = new TextBox(); queryBox.ID = "querybox"; queryBox.ToolTip = "Enter your query here and press submit"; Controls.Add(queryBox); Button queryButton = new Button(); queryButton.UseSubmitBehavior = false; queryButton.ID = "querybutton"; Controls.Add(queryButton); if (Page.IsPostBack == true) { try { string query = querybox.Text; DataGrid dataGrid = new DataGrid();