Hot answers tagged

4

You need to load webpart properties before you can read them. That is, var properties = webPart.get_properties(); currentCtx.load(properties); Then read the properties in success method. currentCtx.executeQueryAsync(...


2

To access SP.WebParts.WebPart Properties it need to be requested explicitly. In your example you could change the expression at the line: currentCtx.load(webPartDefs, 'Include(WebPart)'); with currentCtx.load(webPartDefs, 'Include(WebPart.Properties)'); Modified example var currentCtx = SP.ClientContext.get_current(); var pageFile = ...


1

You can use jQuery (or even plain JavaScript) to get the attribute from the generated for the wev part. The only thing you'd need is somethint that allows you to identify this Web Part even from within the main container. If you own the code for the WP, you can add a custom div with and ID or a class (or data-something), get that using jQuery and then ...


1

Mallu, This can be achieved by creating Editorpart for your custom web part. Lets say the web part that we are building is RightNav.ascx Create a .CS file under your web part (.ascx) Full code of the EditorPart.cs is as follows You may have to edit the code as per your requirements class RightNavEditorPart : EditorPart { ...


1

It seems [ToolboxItemAttribute(false)] is missing on your partial class. Also ordering may be a issue but I am not sure about that. I am giving you a fully functional code snippet where I implemented webpart custom properties. Please update your code as per my below code. Let me know whether it works or not. using System; using System.ComponentModel; using ...



Only top voted, non community-wiki answers of a minimum length are eligible