Contents tagged with SharePoint

  • ASP.NET Javascript DoPostBack and SharePoint: Single Postback Issue

    Here's a quick tip (man, there sure has been a lot of SharePoint in my last few posts!) If you've got a Sharepoint page, and normal postbacks (like paging in your SPGridView or LinkButtons) stop working after you use a __doPostBack() javascript command, try adding the two settings just before your postback: _spFormOnSubmitCalled = false; _spSuppressFormOnSubmitWrapper=true; __doPostBack(' … more

  • Using SPGridView With DataPager (For Nicer Pagination)

    Surprise, surprise - another post about SPGridView. This time, we're looking at how to use the nice .NET 3.5 DataPager control with SPGridView. Out of the box, they don't work together (for the same reason GridView and DataPager don't), because SPGridView doesn't implement the IPageableItemContainer interface, which the DataPager expects. Lucky for us, someone's already done all the hard work … more

  • SPGridView Deep Dive: Custom Filter Menu Values

    Over the last few days, I've learnt far more about SPGridView than I'd ever wanted to know, and here's a gnarly case I worked out and thought I'd share the knowledge! As a base, I'm hoping you've set up a fully functioning SPGridView with custom sort and paging - that's covered via a combination of my previous blog posts on SPGridViews and maybe this guide to the ObjectDataSource itself. If you' … more

  • Strong Naming Assemblies For Sharepoint Part 2: Updating Specific Version References

    Without access to the source code for assemblies, you can add sign / add strong names for them for use in SharePoint via ildasm and ilasm (for which the instructions I previously wrote about). However, consider the scenario where: Assembly A (unsigned) has a reference to a specific version of Assembly B (also unsigned). I tried going the regular ilasm route, but Visual Studio kept complaining … more

  • Signing Compiled Assemblies To Meet Sharepoint's Strong Name Requirements

    Recently been working on some SharePoint stuff which required using a few external libraries - and as you may well know, SharePoint requires you to have strong named assemblies (ie, signed) for them to be deployed to the GAC. So what happens if you're given a compiled .dll, but not the source? Turns out that with a bit of command line / dev tool magic, you can decompile and recompile (with key) … more

  • Pro Tip: Allowing Anonymous Access For A SharePoint Application Page

    A short and sweet one - if you're looking at creating an application page that's accessible to anonymous users of your SharePoint site, there's two things you need to do: Switch the base class of your application page from LayoutsPageBase to UnsecuredLayoutsPageBase Make sure you implement an override for the AllowAnonymousAccess property, and have it always return "true" (or some other … more

  • Prepopulating SummaryLinkWebPart With Links

    Doing some work for a SharePoint Online deployment, and one of the issues with Sandbox/SharePoint Online is that you can't seem to get the SPLimitedWebPartManager to get a reference to WebParts on a page in order to do things such as create Summary Link entries for a Summary Link Web Part. However, it seems like you can actually provision default values for this webpart, either within your Web … more

  • Sharepoint 2010 Pro Tip - List Definition With Many Content Types

    Earlier today, I came across a very interesting issue with a colleague's List Definition. The list contains 12 content types, but for some reason would only show the top eight content types in the list. It deployed fine without any errors, and if you reordered the content types in the definition, the top eight would be deployed. The content types themselves were also exceedingly large, so my … more

  • Nintex Workflow Pro-Tip: Collection Workflow Variables

    Just a quick tip regarding Nintex Workflow 2010 and Collection Variables - when you query a list and assign to a collection variable multiple times, the results are additive; ie, the existing items in the collection aren't replaced as with other workflow variables, but rather are added together. This is only really a problem if you plan to reuse one collection workflow variable multiple times in … more

  • Managed Metadata Fields in SP2010 Content Type Definitions

    I've been creating some content types in SharePoint 2010 recently, which include a few of the new Managed Metadata Fields, and I came across an issue where items created with the content type wouldn't save, and would leave the following error message: Failed to get value of the “{0}” column from the “Managed Metadata” field type control. See details in log. Exception message: Invalid field name. … more

  • Nintex Workflow Pro-Tip: Updating Publishing HTML Fields

    Super, super busy here in Manila, but this was a bit of a gotcha so I thought I'd share: If you're looking to update a list item with a publishing html field, don't use the text box in Update Item action directly, as it will html encode all the angle brackets in your html and generally not work as you'd probably want it to. Instead, you need use the build string action to build your html and … more

  • Pro Tip: SharePoint, NHibernate, Castle, UAC, Exceptions?

    If you're running some NHibernate-enabled .NET inside a SharePoint site, you might one day come across the following exception when viewing the SharePoint site from a browser on-server: System.ArgumentException: Unable to obtain public key for StrongNameKeyPair. at System.Reflection.StrongNameKeyPair.nGetPublicKey(Boolean exported, Byte[] array, String container) at System.Reflection. … more

  • Programmatically Saving Infopath Form To The Current Document Library

    Can be done in three "easy" steps: Store the xmllocation/savelocation query string parameters into the form, or into the form state. Use that in conjunction with SPContext.Current.Web to retrieve the current SPList. (this is because SPContext.Current.List will always return null in InfoPath code) Call the add method on the RootFolder (or whatever folder you require) of the SPList. Here's some … more

  • Disabling Additional Form Validation In Sharepoint 2010

    This problem cost me about four hours of my life, and lots of tedious debugging in Firebug (what I would do without Firebug in my everyday development work, I am not quite sure...) The issue that I had was in a custom ASP.NET control hosted in Sharepoint that had a download file button. Prior to downloading a file, everything works as expected and all javascript calls proceed as per usual. … more

  • Modifying Default ECB Menu Items In Sharepoint 2007

    Recently, I was tasked with replacing the out-of-the-box Version History menu item, and first of all came across the MSDN article on how to hide a menu item in the ECB. The original plan was to remove the existing item, and replace it with a custom Version History menu item - but the MSDN article recommends making an entire copy of core.js and modifying the copy, which seemed like a lot of … more

  • Search Results For Anonymous Users in Sharepoint 2010

    If you're using SharePoint for any public facing websites and are integrating search and are wondering why search results are not coming up when you're not logged in to the site, you aren't alone! Try performing the following simple steps: In your Sharepoint site, head to Site Settings --> Site Administration --> Search and Offline Availability, and change the Indexing ASPX Page Content … more

  • Flash content in Sharepoint Document Libraries

    Today I was working on a site migration from a proprietary CMS into Sharepoint for a client. Their existing site has a flash banner component which I thought would be easy to migrate - however, it turns out that when I package up the file in a module and deploy it as per normal to a Document Library (in this case, the Style Library), linking to the Flash component with <embed> no longer … more

  • 1