Tag Info

Hot answers tagged

12

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


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

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

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

At least you should use the following approach instead of jquery ready function: <script type="text/javascript"> function TheFunctionToDoTheWork() { // Do the work here } // "Subscribe to the SharePoint "page load" _spBodyOnLoadFunctionNames.push('TheFunctionToDoTheWork'); </script> The document.ready in many cases fires too early in ...


4

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(), ...


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.


4

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


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

I believe you can accomplish what you want by adding some code to the property declaration like this: public string TextBox1 { get { if(!String.IsNullOrEmpty(_TextBox1)) { return _TextBox1; } else { return "My Default"; } } set {_TextBox1 = value;} } string _TextBoxl; To be honest there is so much information in your question it is ...


3

To deploy your file so that SharePoint can access it, you have several options but in your case as it is needed only by your feature event receiver you can deploy it under the feature's root folder. To do so, simply put your file inside a module with a deployment type of "ElementFile". Something like: <?xml version="1.0" encoding="utf-8"?> ...


3

To rename the Title that will be visible for the end user, open Elements.xml-file in the webpart-module. Locate the <File>-element and add <Property Name="Title" Value="My Display Title" /> The Elements could look like something like this: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/" ...


3

WebParts (including SummaryLinkWebPart) are simply classes of type Control, so they can be directly added to the masterpage, as Ziga pointed out. First you'll need to add a TagPrefix to the top of your masterpage with the rest of the Tagprefixes to load the appropriate assembly: <%@ Register Tagprefix="SharePointPublishingControls" ...


3

First a number of small remarks: Usually you don't hardcode the URL of the site you want to work against. It may be ok but if you want to access the current site the just use SPContext.Current.Web Unless you need to make updates on a get you shouldn't set AllowUnsafeUpdates A listbox will not allow you to add images inside it (so in my code I just added a ...


3

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


3

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


3

Your code should look like below, its a base class that the webpart calls.... in the base class im setting the webpart settings, Iv made a custom one for you where you will see it in the properties of the webpart when you edit the webpart. private const string c_YourCustomVairable = ""; public BaseWebPart() { _YourCustomVairable= ...


3

Source: Control Web Part Load Order If so you can set these properties in the Property Bag, have a look at SPWeb.Properties. You can modify either in a web browser or via code using the SPLimitedWebPartManager. Use the MoveWebPart method to reorder. Hope this helps


3

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


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

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

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

When adding resources to mapped Resource folder you are placing resx files to <hive>\xx\Resources\ folder and your web part cannot access them. Proper place for this kind of resource is IIS application App_GlobalResources folder (x:\Inetpub\wwwroot\wss\VirtualDirectories\<port>\App_GlobalResources\). Fore more info you can read SharePoint ...


2

(Edit) Sorry, I have deleted my previous answer because I didn't noticed that you said that you have changed your control namespace to be the same used in the Register tag. You said that the exact error is "Could not load file or assembly 'AppsListWebPart'"... could you try to change the AppsListWebPart string in your register comand to the assembly full ...


2

I had the same problem as you. I created a custom web server control based on SPGridView and tries to add it to my Visual Web Control. I solved the problem with this 2 steps. <%@ Register TagPrefix="cc1" Assembly="CustomSpGridView, Version=1.0.0.0, Culture=neutral, PublicKeyToken=562a273772bbe3d8" Namespace=CustomControl" %> Add this to the page ...


2

If you need to create an HttpHandler in SharePoint 2010, you need create a source file with the .ashx extension that contains your code and drop it into your \12\TEMPLATE\LAYOUTS\ folder. The bad deal is that this solution is usefull only if you need to create a preatty simple HttpHandler programming using inline code with no possibilty to debug or test ...


2

Generally, Visual web parts should be created if you want to fully utilize the designer capabilities in Visual Studio.(For e.g. to allow for features such as drag and drop as well as double clicking controls to wire up events). A Visual web part implementation includes an ASP.NET user control, i.e. an .ascx file. All the UI controls and logic goes in user ...



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