Tag Info

Hot answers tagged

13

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


7

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


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

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

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


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

jQuery is one way to do this (feels like everyones choice nowadays). Since you're using a Visual Web Part an ASP.NET Timer control in combination with an UpdatePanel might be a preferred choice in your case, that will also fix both your problems; delay load and refresh.


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

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


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

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


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

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


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

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


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

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

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

You need to add the Cassia DLL to the GAC or assembly folder. You can do it by using gacutil command from visual studio command prompt. gacutil /i C:\mydll.dll Replace the path and name of dll with yours in above.


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

Try to use staffContentInHerePanel.Controls instead of just Controls in your code Something like this... staffContentInHerePanel.Controls.Add(new LiteralControl("</div></div>"));


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

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



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