e.preventdefault(); not working

I had a similar problem, in which e.preventDefault() would work on some cases, but not on others. It showed no errors, and using try-catch was not displaying the catch alert. Adding e.stopImmediatePropagation() did the trick, in case it helps anyone (big thanks to wcpro)

Reasons for a 409/Conflict HTTP error when uploading a file to sharepoint using a .NET WebRequest?

Since no answers were posted, I found the following here: The Web server (running the Web site) thinks that the request submitted by the client (e.g. your Web browser or our CheckUpDown robot) can not be completed because it conflicts with some rule already established. For example, you may get a 409 error if you …

Read more

The HTTP request is unauthorized with client authentication scheme ‘Ntlm’ The authentication header received from the server was ‘NTLM’

Visual Studio 2005 Create a new console application project in Visual Studio Add a “Web Reference” to the Lists.asmx web service. Your URL will probably look like: http://servername/sites/SiteCollection/SubSite/_vti_bin/Lists.asmx I named my web reference: ListsWebService Write the code in program.cs (I have an Issues list here) Here is the code. using System; using System.Collections.Generic; using System.Text; …

Read more

How do you upload a file to a document library in sharepoint?

You can upload documents to SharePoint libraries using the Object Model or SharePoint Webservices. Upload using Object Model: String fileToUpload = @”C:\YourFile.txt”; String sharePointSite = “http://yoursite.com/sites/Research/”; String documentLibraryName = “Shared Documents”; using (SPSite oSite = new SPSite(sharePointSite)) { using (SPWeb oWeb = oSite.OpenWeb()) { if (!System.IO.File.Exists(fileToUpload)) throw new FileNotFoundException(“File not found.”, fileToUpload); SPFolder myLibrary = …

Read more