Hot answers tagged

9

You can choose any of the 3 options from below. Option 1: Replace the default PageNotFoundError.aspx in the Page Library – One of the easiest and Convenient way to replace default text in PageNotFoundError.aspx is to either edit the PageNotFoundError.aspx that resides in the Page Library or to delete it and replace it with a Custom error Page that has the ...


6

.html and .htm are absolutely identical. In terms of apps there is no difference if you are creating .aspx or .html. But you need to consider your requirements carefully. For example, if you need to host on your page some OOB web parts, for example XSLTListViewWebPart: <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="full" ...


5

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 < people.ResolvedEntities.Count;...


5

List -> List Settings -> there is some Info Path forms server settings link that leads to the page where you can remove customization. Changing default Edit/New pages will not help - you need to modify pages for default content type of this list if you want to go this route. You can also able to do this in SharePoint without needing SP Designer. Navigate ...


5

The search box is a server-rendered control, so you can't just redefine the HTML inside it. But, you can use jQuery to just apply the focus after page load. Drop a Script Editor web part onto the page and do something like this: $(document).ready(function(){ $("#SearchBox input").focus(); }); You might need to tweak the selector, but that one worked in ...


5

Upload them into Site Pages library. If you upload them into Document library this is like document not like page. Use correct library template.


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

Modules are used to deploy files to SharePoint Content Database. They can't deploy a file to physical folder. When you add a mapped folder like layouts to SharePoint VS Projects, the files inside the mapped folder automatically get deployed to physical path.


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: ...


3

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);


3

You will need to use CSOM-JS. Refer to this: https://stackoverflow.com/questions/2767461/sharepoint-form-webpart-with-javascript on how your html form should look like and this on how to do basic JS operations in SharePoint 2013: https://msdn.microsoft.com/en-us/library/office/jj163201.aspx (SharePoint 2010: https://msdn.microsoft.com/en-us/library/office/...


3

No need to do this via SharePoint Designer and you should try to Open List > List Settings > Advance Settings > scroll down to dialogs check Yes as shown below.


3

Try accessing the DropDown property of the selectedObject. Haven't tried SPUtility library but looks like (after examining the code) that the HTML object is available in "DropDown" for choice fields. Have a look at the code example here: https://github.com/kitmenke/sputility/blob/master/examples/dropdownchange.html $(countryField.Dropdown) is used to get ...


3

It depends on the page type being used, if it's a Publishing Page, the field name is "PublishingPageContent". If it's a Wiki page, the field name is "WikiField". SharePoint Wiki, Publishing and Web Part Pages UPDATE In case its a modern page in SharePoint Online, it will be "CanvasContent1" Thanks to Gautam Sheth for mentioning this in comments


3

Short answer: Not supported Longer Version: Add a list with links, trim the items in the list and add a list Webpart to the page


2

I faced same issue now. Try to move your code: MyID.ControlMode=SPControlMode.Display; to OnInit or OnLoad event. Page_Load is too far in page live cycle when controls in FormField are already rendered.


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 ...


2

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 ...


2

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, ...


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

Found a solution. Since the old WebPart had its own div-element which was still in the page (even after deleting the WebPart with the SPLimitedWebPartManager) I was able to swap the IDs in the div without adding any extra HTML-code and thus keep the position. Here's the updated Code (just the functionality, without error handling etc) if someone runs into ...


2

First, unless that's a typo, it looks like you are missing a period between your class selectors, so it should be: #id .ms-vb2.ms-vb-lastCell But if the ID still isn't working, taking a quick look at a list view web part (in SP 2013, might be different in 2010, not sure what you are working in), it looks like the table has an attribute summary whose value ...


2

No need to re-invent the wheel in SharePoint Designer. Adjust the list settings > Advanced settings > Launch form in dialog > Yes


2

You can use below script to open webpart page in model dialog <script type="text/javascript"> function ShowDialog(URL) { var options = SP.UI.$create_DialogOptions(); options.url = URL; options.width = 600; options.height = 600; options.title = "...


2

I understand your pain. Its very annoying and frustrating some times when you make a small mistake and need to deploy the complete addin and wait while its deploying. But there is a tool available in VS Market place named as SPFastDeploy. You can use to deploy a single asset file instead of deploying the complete app. Follow the URL to know more about it. ...


2

Not sure if you need a way to do it in aspx directly since you didnt mention, but you could do it in jQuery quite easily. First add a class to your link -> <a href='/sites/****/Lists/Details/NewForm.aspx?Source=' class='addDetails'> + Add New Details</a> Then you retrieve href using jQuery and you save it in a var -> var initialHref = $("....


1

Check out this threads. http://spjsblog.com/2012/02/24/form-field-tooltip-for-sharepoint-2007-and-sharepoint-2010/ You'll have to modify add/new/edit forms of the list or document library you are working with. Then you can use any of the numerous tooltip js libraries i.e. http://jqueryui.com/tooltip/ to add tooltips to your form.


1

REST /_api/Web/SiteUsers JSOM var ctx = SP.ClientContext.get_current(); var users = ctx.get_web().get_siteUsers(); ctx.load(users); ctx.executeQueryAsync(function() { var userArray = []; var e = users.getEnumerator(); while (e.moveNext()) { userArray.push(e.get_current()); } console.log(userArray); });


1

Try the following with Sharepoint designer 1- Add inside as <ParameterBindings> <ParameterBinding Name="ListID" Location="None" DefaultValue="EF49CFE7-C6C4-42D6-8FCB-B10D6CDC0A35"/> <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/> <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="...


1

Try this code $(document).ready(function(){ $().SPServices({ operation: "GetListItems", listName: "Project review", webUrl: "/internal/", async: false, CAMLQuery: "<Query><Where><Gt><FieldRef Name='Id'/><Value Type='Number'>0</Value></Gt></Where></Query>", ...


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