Tag Info

Hot answers tagged

4

Since you have the list name in the query string use it to get SPList as below SPWeb web = SPContext.Current.Web; SPList list = web.GetListFromUrl(web.Url + “/Lists/ListName/Forms/AllItems.aspx“); Then you can get properties from list. Example: String listTitle = list.Title; If you want to get properties from a list item, you can pass item’s ID in the ...


3

this function set field limit characters: function setFieldLimitCharacters( field, limit ) { field.unbind( 'keyup change input paste' ).bind( 'keyup change input paste',function(e){ if( $( this ).val().length > limit ) { $( this ).val( $( this ).val().substring( 0, limit ) ); } }); } usage: ...


2

First thing I want to mention here is the use of list for just 1 item. This is not the way to go. You can use site properties (property bag values) to manage this situation. You can create 3 properties and update values to it. It will save storage and improve performances. You can find in this article how to query property bag values using JavaScript CSOM ...


2

you can do Response.Write, or you can use asp:Literal. var ltlCnt = new LiteralControl(); string divStart = @"<div>"; ltlCnt.Text += divStart; string divEnd = @"</div>"; ltlCnt.Text += divEnd; this.[divOnPage].Controls.Add(ltlCnt);


2

The script will never make it to the client because of the redirect. You either need to send the script with the alert and then postback to perform the redirect (yuck) or perform the redirect in the script by doing a location.replace to the URL you want to redirect to...you could also set location.href to the URL as well. So you could do something like ...


1

I think the issue is the value your retriving is not getting it at the correct moment first time round. Thats why on the second postback it would get the correct item value and its loaded within the context properly. have you tried calling the method out of the page load event? so at bottom code just do showStatusAlert(); instead. or use this method ...


1

If your form is hosted inn SharePoint, You can use server object model for this But as per your query you can trying to host the page in your asp.net web forms application, so for this you can use client object model: Use following method to upload document: public void UploadDocument(string siteURL, string documentListName, string documentListURL, string ...


1

SharePoint 2013/SharePoint Online In .NET Framework 4 was introduced ClientIDMode property that specifies how ASP.NET generates the ClientID for a control that can be accessed in client script. To summarize, since SharePoint 2013 targets .NET Framework 4, ClientIDMode could be utilized that simplifies the access of control in the client side as ...


1

I did that before, but it was for Sharepoint 2010 (see my blog post). The code I used is the one below. It must be inserted into your masterpage, just before the </head> tag : <script type="text/javascript"> function DefaultUploadOverwriteOff() { if (document.title.indexOf("Upload Document") > -1) { var ...


1

DataFormWebPart.ViewFlags property gets or sets the type of content to be displayed by the DataFormWebPart. The DataFormWebPart.ViewFlags property return type is SPViewFlags enumeration that describes the view type of a Web Part: [System.Flags] [SubsetCallableType] public enum SPViewFlags : long { None = 0L, Html = 1L, ClientModified = 2L, ...


1

Your problem can be solved via JsLink as well as overriding methods from the sp.ui.discussions.js file under the layouts hive. And about maintenability, this file is easy to maintain because you only change the text of the variable "NewDiscussionTitle" var newDiscussionTitle = "Your Custom New Text "; SP.UI.Discussions.HeaderBehavior.prototype.render = ...


1

Preface, tried this on SP2010 not 2013: Something you can try is creating a new content type that inherits from the Discussion content type. Then in your discussion list, go to the list settings and add your newly created content type and delete the discussion content type. When selecting to create a new item, the content type name will be present. Then ...


1

This is a broad question and there are multiple ways to approach it. First, you need to decide where to get the "associated information". If it's just a couple fields, you could consider loading it within the data view. If it is a bigger chunk (e.g. includes images), then you'll load it on demand with an AJAX call when the user selects an item. [Edit] ...


1

These methods registers and adds the script block to the page. So it will fire after the page is rendered from the server. In your case you are redirecting to some other page while the script is registered on the previous page. So it would not fire on the previous page.


1

Alex, You should set the control as follow: MyCustomField.ItemFieldValue = "1"; MyCustomField.Field.DefaultValue = "1"; Where 1 is for true, and 0 is for false


1

This is what I have been using to get an SPFieldUserValue from the resolved users and groups in a PeopleEditor control. public static SPFieldUserValue GetPeopleFromPickerControl(PeopleEditor people, SPWeb web) { SPFieldUserValue value = null; if (people.ResolvedEntities.Count > 0) { for (int i = 0; i < ...


1

MetadataNavigationTree only displays when you are on a page/list/library which has Metadata configured - All Publishing lists and libraries has this as well as the system pages by default. There exist many ways. Most common is a hidden webpart (HTML Form Web Part) with some javascript.


1

When you deploy a web part in SharePoint, you provide it a type and assembly in an xml file that registers the web part in SharePoint. Look at this: Web Part Deployment In the .webpart file you'll see the line <type name="ExecutionModels.Sandboxed.AggregateView.AggregateView, $SharePoint.Project.AssemblyFullName$" /> If you're rebuilding the ...


1

Have a look here on MSDN. I think FormUrls can be of help in your case. This schema enables you to specify client-side redirects to different Display, Edit, and New form pages for items of this content type.


1

In Discussion Board for storing questions (Body field in Discussion Content Types) and answers (Body field in Message Content Type) is used Enhanced Rich Text field that allows to upload files and insert file links. So, Upload file RTE command could be used to upload files into Documents library and insert links into questions and answers in ...



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