Get the masterpage name in C#

If you need to access the name of the current pages sharepoint master page within a UserControl, just reference the Page object and access its MasterPageFile variable



public partial class CustomUserControl : UserControl
{

    protected void Page_Load(object sender, EventArgs e)
    {
        String currentMasterPage = Page.MasterPageFile;
    }
}

 

How to display a single list item on a sharepoint page

Its quite interesting, there are loads of articles showing how to display multiple items from a list but what if you only want to display one list item and have it formatted nicely. Of course you could use jQuery but if you want do do it without the little javascript angel then the content query webpart (CQWP) will answer your prayers.

 

Returning the new id with spservices UpdateListItems

To retrieve the ID of a new item added to a list using spservices use this line of code in the completefunc

 

SPServices - Get created by or modified by values with GetListItems

Quick tip

When using GetListItems with SPServices, to retrieve list items, there will be situations when you want to also get the created by and modified by values as well... Intuition tells you that it should be something like FieldRef='Created_x0020_By' or FieldRef='Modified_x0020_By' but this is not the case

Created by is actually a field called 'Author' and Modified by is a field called 'Editor'.

Incidentally... to find out what the field is called, visit the list settings page of the list you are trying to get information from, hover over the column you would like. There should be a url that appears when you hover depending on your browser... at the end of the url is the field name that you need.

 

Managing javascript development on sharepoint

Mixing javascript and application wsp code can be a bit of a nightmare for web developers new to sharepoint... and also for sharepoint/application developer who are new to web development technologies

Separating your javascript and css code, into .js and .css files, and out from your application code will make it significantly easier to develop and here's why...

 

More Articles...

  1. Simple check list with jQuery
  2. Add Jquery to sharepoint without altering the masterpage
  3. Sharepoint ribbon markup styles not working...
  4. Referencing javascript files from a masterpage
  5. Adding files to a feature directory
  6. Using jQuery daterangepicker with Sharepoint lists
  7. Cookies: Setting and getting with PHP
  8. How to clear a cookie with ColdFusion
  9. How to send an email with php
  10. How to get a visitors IP address with PHP
  11. Get current page url with php
  12. How to remove html tags with php
  13. XSLT snippet... Getting a hyperlink column description
  14. Render a list as a news ticker using XSLT
  15. Render a slideshow gallery from a sharepoint list using XSLT and ContentQueries
  16. Displaying the current row in ItemStyle.xsl
  17. Accordion style quick launch on sharepoint 2010
  18. cSharp snippet - SP2010 programatic list sort
  19. cSharp snippet - List attachments file URLs
  20. Adding items to the user/welcome menu in sharepoint 2010
  21. List filtering by date range
  22. Infopath - filter data shown in dropdown list by user
  23. Sharepoint2010 view style reference
  24. Using a DATE FILTER on a list
  25. Using a CURRENT USER FILTER on a list
  26. Adding a list webpart to a page
  27. Creating a basic sharepoint list
  28. Turning an email address into an image using ColdFusion
  29. Quick tip: Lanuage accents not showing up in flex?
  30. Adding Google Analytics to your cairngorm app
  31. Embedding mp3 sounds in flex css stylesheets
  32. Creating an auto hide toolbar in flex
  33. Avanti Blade 2 review
  34. Verity CFSearch error, status code (-2)
  35. Flex 3 rotating image script
  36. My first Cairngorm Flex app - that poker clock
  37. Large font sizes in flex 3
  38. Background image repeat in flex 3
  39. How to set multiple defaults in a list control
  40. com.verity.coll.VCollectionNotAvailableException: Collection down after opening. (10)
  41. PHP -Search for a file on a site
  42. JCard! - Joomla
  43. Replacing html forms with flex2
  44. How to prevent form resubmission
  45. Must have firefox extensions
  46. Using lists IN queries
  47. Flex and the webcam
  48. Flex and the webcam pt2
  49. Flex and the webcam pt3
  50. Flex and the webcam pt4
  51. JHide!
  52. PHP - What files on a site have been modified?
  53. PHP - Compare directories for file changes
  54. Firefox TradeMe search extension.
  55. Strict menu - Joomla
  56. The Replacer beta - joomla regular expression replacement tool
  57. PHP - Unzip an uploaded file using php
  58. PHP - CHMOD a directory recursively