Tag Info

Hot answers tagged

6

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


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

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


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

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


3

change your code to: <Taxonomy:TaxonomyWebTaggingControl runat="server" ID="taxProjectOwnerDepartment" Visible="true" IsMulti="false" IsDisplayPickerButton="true"> </Taxonomy:TaxonomyWebTaggingControl> <asp:CustomValidator ID="rfvProjectOwnerDepartment" runat="server" OnServerValidate="validator_ServerValidate" /> now in your ...


3

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" />


3

You can create a quick and dirty copy of the list from the production server by creating a list template from the list settings screen. When you create the list template, you will be given the option to include the content as well. Make sure that is checked. Download the file from the list template gallery in production, then upload the file to the list ...


2

You can specify QuickAddGroups in the Elements.xml like this: <File Type="GhostableInLibrary" Url="AuthoredListFilter.webpart"> <Property Name="Group" Value="$Resources:spscore,FiltersWebPartGroup;" /> <Property Name="QuickAddGroups" Value=";#Filters;#My Site: Middle Right;#My Site: Middle Left;#My Site: Bottom;#" /> </File> ...


2

You can use the SPQuery. SPQuery Query = new SPQuery(); Query.Folder = SPFolder Object; Query.Query = "insert caml query here..." SPListItemCollection collListItems = List.GetItems(oQuery); I would suggest doing some reading first before implementing this if you haven't used Spquery before.... You may want to look into the row limits and view attributes ...


2

What is the real objective? As far as I know there is no easy way of, from a webpart knowing if the page (list item) has just been published or checked in. You can use the following code to check if the page is in display or edit mode and take some action: if (Microsoft.SharePoint.SPContext.Current.FormContext.FormMode == SPControlMode.Display) { // ...


2

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


2

Yes this is normal behavior. SPContext.Current.Web will only allow you to access lists from the current site. Before you access an outside list, you must open the SPWeb object of the site which contains the list. Example: using(SPSite site = new SPSite("url/of/child/or/parent/site") { using(SPWeb web = new site.OpenWeb()) { SPList list = ...


2

When working with URLs in SharePoint, there are two very helpful utility classes: SPUtility and SPUrlUtility There are three different kinds of url used in different properties of various SharePoint objects: absolute, server-relative and site-relative. One need to be careful with them, especially when site collection is not located directly at web ...


2

You can add the layouts mapped folder to your project and keep javascript and css files there.You can then use ScriptLink class to register the js and CssRegistration class to register the css in the Page_Load method of the webpart. Following is the example: private const string script = "/_layouts/JQuery/JS/jquery.min.js"; ScriptLink.Register(Page, script ...


2

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.


2

For Site and Web scoped feature, only way is to use the powershell to activate the feature after it is deployed. (But for Farm and Web Application scoped features, Go to the manifest of your feature and set "ActivateOnDefault" to true, this will cause the feature to get activated automatically whenever the solution is deployed using powershell or central ...


2

TaxonomyWebTaggingControl on the server side TaxonomyWebTaggingControl.Text Property is used to set or get value that represent a Term object Get values from this control as pairs of labels and GUIDs. The delimiter between a label and a GUID is the | character. When using multiple values, delimit them with a ; character. Example: ...


2

You can not upload files to the hive like that. In this case you would have to upload the image to a Library on your SharePoint site/web Read more about the Hive folders here (for 2010 but still very valid if you replace 14 with 15). Since these folders are virtual, every single site and web in your SharePoint Farm will have access to, and use the same ...


2

When you add runat="server" to a div tag it gets an auto generated id. So when you in javascript or jQuery wants to get an element by ID and that element has the runat="server" attribute, then you need to use inline code to get it. Example without runat="server" attribute [HTML] <div id="MyDIV">some content </div> [jQuery] var mydiv = ...


2

There are two ways to use resource file. In .ascx file: <asp:Label ID="lbl1" runat="server" Text="<%$Resources:ResourcesFileName, ResourceFileItemKey %>" And in .cs file use SPUtility.GetLocalizedString() method For the second option your resource file should be present in sharepoint mapped resources folder. For more details visit this link ...


2

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


2

in your webpart you need to change the web.config: <pages enableSessionState="false" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=*******" asyncTimeout="7"> to ...


2

You must use code like this to get image url: SPList spList = web.Lists["ImagesLibrary"]; SPListItem item = spList.Items.GetItemById(itemID); //Thumbnail Url string thumbnailUrl = item[SPBuiltInFieldId.EncodedAbsThumbnailUrl].ToString(); //Picture Url string pictureUrl = item[SPBuiltInFieldId.EncodedAbsUrl].ToString(); The above Urls are the full Urls ...


2

You can create a single global resources file and deploy it to: {WebApplicationRoot}\App_GlobalResources\ This post shows you more on how to do it: http://blogbaris.blogspot.co.uk/2012/07/localization-with-sharepoint-2010-and.html The post is based on SP2010 but works just as well for SP2013


2

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


1

please refer to this: it will explain what im about to talk about! your using the spcontext is first where your going wrong! What is the difference between SPContext.Current.Web and SPContext.Current.Site.OpenWeb()? runwithelevatedpriv under security just doesnt work! if you use it to get the url and then set the context to openweb() than that is fine! ...


1

your code is fine appart from one part, you looping on the validation! you need to set date type at the end: so you have: ControlToValidate="dtcProjectPlannedEndDate$dtcProjectPlannedEndDate" should be: ControlToValidate="dtcProjectPlannedEndDate$dtcProjectPlannedEndDateDate" i got that from the error you shown: Unable to find control id ...


1

The approach can all be done in PowerShell, First, you add the solution to the solution gallery if it's not already added using this command: " Add-SPSolution -LiteralPath "path to the wsp file" Then you install (deploy) the solution, note that PowerShell uses different terms when it deals with WSP files and features. To install (Deploy) the solution so ...


1

Have a look at the properties on the feature within VS -- there are a couple of options there that will control how the features behave when the solution is deployed via VS ( only ).. these settings have no affect on the solution once it is out of VS... Activate On Default - Indicates whether the feature is activated during installation. ...this is what you ...



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