Hot answers tagged

9

You can't change the .master file when it's bound like this, you can only edit the .html file. It will re-generate the .master when you save the .html. This is due to the Design Manager packet in SP2013. Here's the MSDN article on this feature set: http://msdn.microsoft.com/en-us/library/office/jj822363(v=office.15).aspx


9

The issue is that you should copy seattle.html which will auto create a .master page for you, and there is a link between the files. To resolve the issue, create a copy of seattle.html Now you have both a seattle_copy(1).html and seattle_copy(1).master. Next rename seattle_copy(1).html to for example test.html. A pop-up appears asking you to update pages ...


9

I think I found a solution for appWebUrl. ssdar's answer gave me the same problem as I initially had with loading different pages, but another answer in the thread they linked to contained an answer that led me to the right path. Instead of: var appWebUrl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl')); var hostUrl = decodeURIComponent(...


7

Right click on your solution -> Select Set Startup Projects -> Choose Multiple Startup Projects -> and select Start action for both app and app web projects. Also, app web project should be the first one. This should do the trick.


6

David, I guess there is a MultiSelect property which you can set to false to allow only a single entry of User/Group For example: PeopleEditor Control - The article is for SP 2007 but I hope its the same in 2013


6

That code is not ASPX code. It is JavaScript code (inside a Script block in your ASPX file?) If it is not a Global variable yet, you can declare it as window.js=res[1] to force it in the global scope (and thus available to all other functions) Time to read about Javascript Variables, Closures etc. : https://developer.mozilla.org/en-US/docs/Web/JavaScript/...


5

The SharePoint WebPart has its roots back from the 2003 version where it inherited directly from Control because ASP.NET had no concept of a web part and SharePoint as in many other cases implemented a lot of the functionallity which was moved into ASP.NET 2.0 in order to allow SharePoint to become a real ASP.NET application in 2007. After ASP.NET 2.0 ...


5

Few points you need to make corrections InitializeControl() instead of InitializeControls() You will find a ".ascx.g.cs" file once you expand '.ascx" file. Change the namespace to same as in ".ascx.cs" file. make sure you have same class name in both the files. Replace if it is displaying some other class name in ".ascx.g.cs" file. Replace it where ever you ...


4

Here is a link to all possible values: http://msdn.microsoft.com/EN-US/library/ms412690 In your case you should use EditListItem or AddAndCustomizePages depending on type of page and more exact scenario. The MSDN above has the full definitions for the two options. If not one specific is doing it for you, you can combine multiple ones by separating them ...


4

It depends on your needs of course. But if only for storage and security, foundation should be enough. You can use the managed client object model for communication with SharePoint from your MVC app: http://msdn.microsoft.com/en-us/library/ee857094(v=office.14).aspx OR, Since you use 2013: You could add a SharePoint Provider Hosted App to your MVC ...


4

As mentioned in the blog post you references, it simply needs to happen after the response has been created (i.e. the page content) and before the UpdateRequestCache event. The blog post shows an idea example of using the PostRequestReleaseState event. This happens almost immediately after the response is generated. public void Init(HttpApplication app) ...


4

You can use below snippet to convert it programmatically SPRegionalSettings regionalSettings = web.RegionalSettings; SPTimeZone timeZone = regionalSettings.TimeZone; timeZone.UTCToLocalTime(dateTimeObject);


4

try disabling HtmlEncode. <asp:BoundField DataField="Your Column Name" HtmlEncode="false" /> BoundField.HtmlEncode Property in MSDN https://stackoverflow.com/a/27720086/1294606


4

If Constants.CLIENT_FIELD_PARENT_ID is the name of a multivalue lookup column then the value for that should be in the format Id1;#Value1;#Id2;#Value2 or without values Id1;#;#Id2;# Which will give this code batch.InnerXml = "<Method ID='1' Cmd='New'>" + "<Field Name='" + Constants.Client_Field_FirstName + "'>" + clientObj....


4

There aren't any technical advantages to using this method. It simply allowed developers to use the same conventions they used on the client (JavaScript) as they used on the server (ASP.NET SharePoint solutions). The JavaScript Object Model code is transpiled from the C# Client Object Model -- lots of things in the Microsoft Ajax libraries exist to make ...


4

I am pre-assuming that you are adding this in your user control or visual web part. You can add button click event in various methods: C# Your HTML part: <asp:Button id="Button1" Text="Click here for greeting..." OnClick="GreetingBtn_Click" runat="server"/> In code behind file there is one method for click event: protected void GreetingBtn_Click(...


3

You could use relative paths, like in most web development, like /_layouts/images/hello.jpg Or use SPUrl tokens inline in the src or href attribute. See more here: http://hristopavlov.wordpress.com/2008/12/08/urlaction-tokens-of-the-customaction-feature/ This link is 2007, but most tokens should still be valid!


3

The problem is likely because you are using jQuery 2.0 which does not have support for IE 6/7/8 or IE 9/10 when running in compatibility mode (which I'm guessing SP 2010 is using. You can confirm this by using the F12 developer tools). I would recommend using jQuery 1.9.1 for use with SharePoint and so you still have support for the older browsers.


3

That depends where you are using it. If you are just using it via a list field, then set the properties for that field. If you are using it as a server side control in your code then refer to MSDN for all the properties. The specific property you want to set is: peopleEditor.MultiSelect = false; Karine Bosch also has a really good article on how to use ...


3

Either grant the anonymous user access to SQL (Not recommended) or make use of the SPSecurity.RunWithElevatedPrivileges feature in SharePoint when calling the database. Using that will execute the code as the pool account rather than as the user account. The full details are on MSDN, just be sure to instantiate your SPSite object inside the code block ...


3

In IIS8 (which you are using, if you are using SharePoint 2013) it uses ASP.NET 4.5. The application events are different from 3.5 and are raised in the following order: BeginRequest AuthenticateRequest PostAuthenticateRequest AuthorizeRequest PostAuthorizeRequest ResolveRequestCache PostResolveRequestCache After the PostResolveRequestCache event ...


3

If its your development environment, try IISReset.. Also if that doesn't work, restart SharePoint Timer Job.. You can restart SPTimerV4 service for restarting SharePoint Timer Job, write following in Command Prompt: net stop SPTimerV4 net start SPTimerV4


3

Your asp.net application would need to use the client API for SharePoint (aka CSOM), you can think of it like a provider hosted app in 2013 (but without the app web) Here is a great starting point for CSOM: http://msdn.microsoft.com/en-us/library/office/fp179912(v=office.15).aspx


3

It depends on what you want to do with the data, I'd say. In general, I would recommend the custom list approach, especially if the purpose of the form is to collect data and use it later. Recently, I built a custom 'poll' web part that did just this - I had a PollResponses list that stored the choice the user submitted through an AJAX request, and then I ...


3

First of all, you have an update panel. With that you have a few options. You could wire up a server side event to your button and hide the div on button click. The button click would cause an Async Postback which would just update the content inside of your update panel. One issue with your code is you are using normal html elements. To make your ...


3

That's one of the UI issues in SharePoint 2013, that when Enhanced Rich Text is selected the required validation message appears twice. I don't know if there is an update available to fix this (and other issues). But you can try some JS/jQuery to hide one of them.


3

If you didn't had a page already existing with name = "WelcomeNew", then people will try to access site and get Page Not Found error. An Ideal SharePoint approach is a follows Create an External Content Type (ECT) and use this to connect to you SQL Server In ECT you can define methods which you want to act on the backend (Ex: SQL Table) Read All Items ...


3

You need to create the HTML <select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> So you have to append the OPTION DOM elements


3

This error exception is thrown mostly when you try accessing an item at an index that isn't present. The best way to resolve the issue is to debug and check the length of the array or the data table indexes and then see whether you are deleting the correct index or not. As per described in the comments below you would need to mention the column index that ...


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