web-parts

How to get all document libraries BUT Form Templates, Style, Customized Reports

蓝咒 提交于 2019-12-05 06:50:17
I'm building a webpart for SharePoint 2010 to get all the document libraries with usefull info for the user. This means, docs that users uploaded, etc. I don't want to show libraries such as Form Templates, Style Library, Customized Reports, etc... I just want to show only the document libraries with usefull info, as Shared Documents, or any other users create in the future, is that possible? Currently, my logic looks like this: SPListCollection docLibraryColl = wb.GetListsOfType(SPBaseType.DocumentLibrary); Guid docLibFeatId = new Guid("00bfea71-e717-4e80-aa17-d0c71b360101"); foreach (SPList

How can you have SharePoint Link Lists default to opening in a new window?

霸气de小男生 提交于 2019-12-04 22:35:33
问题 In SharePoint, it is easy to set up a List webpart consisting of Links to other documents, folders, sites, etc. Unfortunately, when clicking these links, the default behavior is for the page to open in the current browser window. That is, it does NOT open the page in a new instance of the browser. This has proven annoying for a number of the users on my site. Does anyone know of a way to have the default behavior be to open in a NEW browser window? I'm hoping this is something that can be set

Hiding default properties for a custom visual web part

走远了吗. 提交于 2019-12-04 20:24:32
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. Joel Jeffery Here's one way to achieve this. In your EditorPart, mark the container of the other EditorParts as not Visible: class EditorPartTest : EditorPart { protected

Possible to load a web part inside another?

喜夏-厌秋 提交于 2019-12-04 08:31:57
问题 So, this is what we want to do: We want to have a generic web part with a custom frame around it and then dynamically load other web parts (frameless) inside it. Would this at all be possible you think? A bit like Jan Tielens SmartPart, only not for ASP.Net User Controls, but for other Web parts... ;) Edit: We've been able to do this now. The solution was actually pretty simple. Check out the code: public class WebPartWrapper : System.Web.UI.WebControls.WebParts.WebPart { protected override

GridView SelectMethod Issue With WebPart Sharepoint 2013

家住魔仙堡 提交于 2019-12-04 06:39:09
问题 Hi every one , I have a problem with a gridview in webpart sharepoint 2013 ,I use model bind with the gridview and I have assigned a select method to the gridview when I deployed the webpart it raise the following error A public method with the name was either not found or there were multiple methods with the same name on the type x.master thanks alot 回答1: I have found the solution , you need to register this code within the CallingDataMethod GridView event : protected void GridView1

How to display an image in a SharePoint 2010 Web Part

那年仲夏 提交于 2019-12-04 06:31:49
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. 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-an-image-in-a-sharepoint-2010-web-part

Sharepoint 2010 - Create a custom menu

偶尔善良 提交于 2019-12-04 06:14:10
问题 Does anybody knows a good step by step tutorial to create a custom menu like the standard QuickLaunchMenu (SharePoint:AspMenu) or a good tutorial to modify the existing QuickLaunchMenu? I'd like to add a background image attribute to the sitemap. This image should be rendered in every menu item. I have no idea how to create a costum menu. Any help would be appreciated. thx 回答1: No need to use a custom menu. I suggest you use CSS to add your image to every navigation item. 回答2: Here is a good

Run exe from Sharepoint web part

早过忘川 提交于 2019-12-04 05:16:22
问题 I have a button in a sharepoint web part that when clicked is supposed to launch the calculator: protected void Button1_Click(object sender, EventArgs e) { Process process = new Process(); process.StartInfo = new ProcessStartInfo("Calc.exe"); process.Start(); } However, when the button is clicked, nothing happens. Can someone tell me how to launch applications from a sharepoint web part? 回答1: Quite frankly this is not possible. The code you have written is executed on the SharePoint server in

Sharepoint custom web part property does not show up in the toolbox

痞子三分冷 提交于 2019-12-04 02:06:08
I have defined a boolean property as follows: [Browsable(true), Category("Display"), DefaultValue(false), WebPartStorage(Storage.Shared), FriendlyName("Obey Workflow"), Description("")] public bool ObeyWorkflow { get; set; } I'm expecting it to render as a checkbox in the webpart's properties toolbox, however it doesn't show up. My web part is derived from the Sharepoint WebPart base class. You are on the right track. You just need to use different attributes. [Personalizable(PersonalizationScope.Shared)] [WebBrowsable(true)] [Category("Display")] [WebDisplayName("Obey Workflow")] [Description

Datetime comparison in CAML Query for Sharepoint

不打扰是莪最后的温柔 提交于 2019-12-03 16:50:05
问题 i'm trying to have some item from a sharepoint list, depends on date in a custom column. I've created my query with U2U Caml Builder, and that's worked but when I put it in my own code in my webpart, it always return to me all the items od the list. Here is my code: DateTime startDate = new DateTime(Int32.Parse(year), 1, 1); DateTime endDate = new DateTime(Int32.Parse(year), 12, 31); SPQuery q = new SPQuery(); q.Query = "<Query><Where><And><Geq><FieldRef Name='Publicate Date' /><Value