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

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

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

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

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

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

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


3

Use can use HtmlDecode for it. eg: In RowDataBound event use if (e.Row.RowType == DataControlRowType.DataRow) { string decodedText = HttpUtility.HtmlDecode(e.Row.Cells[0].Text); e.Row.Cells[0].Text = decodedText; }


3

Because you have called the Response.End(), which ends the page execution, the body onload event would never be fired. The problem is sharepoint catches form submits and downloads so you cannot double click a button. I had same issue, adding below script on aspx page helped me to resolve it <script type='text/javascript'> _spOriginalFormAction = ...


3

From where DropDown1 came? In your code you are adding items in DropDownList4 and you are trying to access the value from DropDown1. Your code should be like: string selectedvalyear = Convert.ToString(DropDownList4.SelectedItem); Label1.Text = selectedvalyear; If you want to change the value of Lable1 from dropdown every time when you change item, then ...


3

To get a SharePoint Choice Field value SPFieldChoice myChoicesfield = (SPFieldChoice)list.Fields["FieldName"]; for (int i = 0; i < myChoicesfield.Choices.Count; i++) { DropDownListName.Items.Add(myChoicesfield.Choices[i].ToString()); } To get a SharePoint Multiple Choice Field value SPFieldMultiChoiceValue ...


3

Is there a way I could get the data from the SharePoint web application from my asp.net app without installing SharePoint foundation on the asp.net server? Yes, you can read data from SharePoint in your ASP.NET Using SharePoint CSOM. Client-Side Object Model (CSOM) is mainly used to build client applications and enable us to access SharePoint Sites that ...


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