Hot answers tagged

19

Short explanation: As far as usage is concerned, in many common cases there are almost no actual differences - anything you can do with a webpart you could do with a visual web part. For many points of view the visual web part is only a tool that enables the developer to work with a user control instead of creating all controls in codebehind. Visual web ...


13

I had the same problem today. I compared the project files with an older version. In my case the Package directory (with the files Package.package and Package.Template.xml) was missing. After copying this directory back from the older version of the project and modifying the csproj file to include the references to the package directory, the error solved ...


7

There's not a huge difference for all of them. 3 out of 4 of them are server-side controls. And the SharePoint:InputFormTextBox and wssawc:InputFormTextBox are the exact same, only the prefix namespace (i.e. SharePoint, wssawc) is the difference. SharePoint/wssawc:InputFormTextBox has built-in co-operative field validation, the others don't. That's the ...


6

a- Add reference to "Microsoft.SharePoint.Taxonomy" assembly b- You need to register following Assembly in your Web Part <%@ Register TagPrefix="Taxonomy" Namespace="Microsoft.SharePoint.Taxonomy" Assembly="Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> c- You can use the control as following ...


6

I suggest you should deal with the problem after going through httphandler development and its deployment in IIS 7 and ASP.NET 3.5. Here is a good link : http://msdn.microsoft.com/en-us/library/bb398986(v=VS.90).aspx (See various walk-through and consider asynchronous handlers as you deal in asynchronous way) If you think you know it all, Please ensure : ...


6

Try: SPFieldUserValue userValue = new SPFieldUserValue(web, item["Created By"].ToString()); string Author = userValue.LookupValue;


5

The Page object you're getting in the Sandboxed webpart isn't the real page, so this in one of the things that won't work. Option 1: Render in RenderContents You can manually render your script include in RenderContents: protected override void RenderContents(HtmlTextWriter writer) { string jQuerySrc = Page.ClientScript.GetWebResourceUrl(this.GetType(), ...


5

It's the PeopleEditor control. Here's the good article about it. It's about 2007 version but there's no changes in 2010.


5

If you don't want other people to be able to Reverse Engineer the source code to DLLs you're giving them, then you should obfuscate the DLL. See .Net Obfuscation for some suggestions. But before going in that direction I have a couple of comments: The only people who can get the DLL is the people with access to WSP (or the farm where it's installed). Not ...


5

Using JSOM in the past I have experienced this trouble when I have a lack of system resources, specifically when my systems RAM has less than 5% available. The fact that you are getting a Service Activation Exception leads me to believe this may very well be the case, and can be verified in Windows event viewer. Close some applications or disable some ...


5

Do you know how to build a basic web part? If not I suggest you learn this first. Here's a sample tutorial: http://msdn.microsoft.com/en-GB/library/ms415817(v=office.14).aspx Next you want to learn how to develop against web services. Helpfully, Yahoo have a tutorial on how to deal with responses to web services as XML within C# applications: ...


5

I think the problem is src attribute of tag. Try <script src="/StyleLibrary/js/jquery-1.9.1.min.js" /> and take a look at this article Edit If you decide to store js in _layouts folder, use <SharePoint:ScriptLink runat="server" ID="ScriptLinkJQuery" name="/Js/jquery-1.9.1.min.js" Localizable="false" />


5

In general, you should avoid directly connecting to PRODUCTION for any sort of development or debugging. Consider bringing the list to your development environment. You can use import/export or consider saving list as template and install the template in Dev environment. How should you develop, debug and deploy sharepoint solutions? The serious ...


5

Here is a way to do it in sharepoint 2013 in visual studio 2012 1)Create a empty sharepoint 13 solution Farm solution . 2) Add a sharepoin 13 project into it . 3)Add a mapped foder "Resources" to the project . 4)Now you gonna add three resources one for english "testMutliLing.en-US.resx" and one for german "testMutliLing.de-DE.resx" and one default ...


4

I think that <%@ Assembly Name="$Sharepoint.Project.AssemblyFullName$" %> when you deploy on your prod server, that code is not replaced by Visual Studio, thus you need to specify full name of the assembly you have developed, you can get it from .webpart file. That happens due to http://msdn.microsoft.com/en-us/library/ee231545.aspx, VS 2010 ...


4

You'd need to enable Session State in your web application. Execute the following powershell script Enable-SPSessionStateService –DefaultProvision Apply the following web.config change: pages enableSessionState="true" More information is available at: Using Session State in SharePoint 2010


4

You'll need the full four part assembly name, with the Assembly, Version, Culture and PublicKey, to reference an assembly in the GAC.


4

That is simple. Do not have two references to jQuery in your webparts. Load jQuery only once. What happens is that a new jQuery overrides all the extensions... Consider this. Every js code declared as <script> is loaded synchronously. Web Part 1 loads jQuery and fancybox. Fancybox is an extension of jQuery. Web Part 2 loads jQuery again, and ...


4

This may be unrelated, but did you put a proper URL in your project's Site URL field, and can you properly deploy and activate an empty solution from VS? I find that the designer files are not generated properly if my site URL is faulty (VS can't connect to it) or if I lack the permissions to deploy and activate a solution from within Visual Studio.


4

You need to load webpart properties before you can read them. That is, var properties = webPart.get_properties(); currentCtx.load(properties); Then read the properties in success method. currentCtx.executeQueryAsync(...


4

You should always select your list based on the URL, as the Title is more likely to change. And don't do SPWeb.Lists as this will enumerate all lists on the web site. Use this similar snippet instead: public Guid? GetListId(string siteUrl, string listUrl) { using (var currentSite = new SPSite(siteUrl)) { using (var currentWeb = ...


4

Fixed it by using the following code: private const string _ascxPath = @"~/_CONTROLTEMPLATES/15/VisualWebPartProject/Export/ExportControl.ascx"; Note I just added 15 after CONTROLTEMPLATES.


4

Package a WSP Right click your project in the right column. Then click "Publish". A dialog will open, where you will get to choose where to place the resulting .wsp file. After clicking "Publish" your project will be build and then packaged in the selected location. Make sure to have the Solution configuration set to Release when building for production. ...


4

I found answer for my question. private string GetAttachmentUrls(SPListItem oItem) { string path = string.Empty; try { path = (from string file in oItem.Attachments orderby file select SPUrlUtility.CombineUrl(oItem.Attachments.UrlPrefix, ...


4

Erm - you can just concatenate it into the string? pdquery.Query = "<Where><Eq><FieldRef Name='Name'/><Value Type='Text'>" + yourParameter + "</Value></Eq></Where>"


4

You will need to re-activate the feature that you updated. Upon re-activation, the web part should show in the gallery.


4

I have put your code in the page load event and it resolves the issue. btnExport.UseSubmitBehavior = false; btnExport.OnClientClick = "_spFormOnSubmitCalled = false; _spSuppressFormOnSubmitWrapper=true;";


4

To add the normal people picker to a web part you can use Microsoft.SharePoint.UserControls.PeopleEditor or <SharePoint:PeopleEditor ID="myPeoplePicker" runat="server" Width="300" BorderStyle="Solid" BorderColor="Black" BorderWidth="1" /> Check out the below link, it has complete code: ...


4

If you wanted to do it the "right" way then you should have used Feature Upgrading. It's unfortunately not simple but gives you a lot of control of what happens when you deploy a new version of a feature. In your case it would have involved: Add the elements.xml files for the new web parts inside <ApplyElementManifests> inside ...


4

You can't use AppGlobalResource or <%$Resources:RESXFILE,RESOURCEKEY%> in Sandboxed solutions. See Localization in SharePoint 2010 Sandbox Solutions for how to use resources in Sandboxed solutions.



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