Posts

Showing posts from 2010

Serialize and Deserialize with JSON : example

      class   Program     {         static   void Main( string [] args)         {             var human1 = new   Human () {                 Name = "Joe" ,                 Age = 30,                 Children = new   List < Human >                 {                     new   Human () {Name= "Jim" , Age=3},                   ...

Greate ASP.NET DEMO Gallery

  http://mattberseth2.com/demo/

InternalName versus DisplayName

When creating columns (more commonly called fields) in SharePoint through the interface, you have to enter a name for it. This name is used throughout the lists and sites, included internally. Except when you try to change the name, it’ll only reflect on the outside. Internally the old name will be kept. This is because a field has two names: an internal name and a display name. When creating a field, you set both. When renaming it, you only change the display name. (There is actually no way to change the internal name afterwards) But why is this a concern? Well, in the object model it can become quite vague when to use the internal name and when to use the display name. Here is a short list with some common methods and the name they need. SPFieldCollection[name] : SPField name : DisplayName unexistent : exception SPFieldCollection.GetField(name) : SPField name: internalName, displayName or internalName and displayName from the current context unexistent: exception SPFieldCollectio...

Coder Toolbox

A website allows you to encode, decode string. http://coderstoolbox.net/string/

DataBinding in Nested Controls

Image
  Ref: http://leeontech.wordpress.com/2009/08/27/databinding-in-nested-controls/ Databinding can get tricky in a hurry depending on the layout we have and the model we are binding to. Dan Wahlin suggests a way in this post Here is another way without any code or additional classes. DataContext is setup to be a instance of data, which has list of customers(having name and city as properties) and an array of strings for cities. we would like to display customers in datagrid and display list of Cities in ComboBox and select the appropriate city for the customer namespace SilverlightApplication2 {     public partial class MainPage : UserControl     {         public MainPage()         {             InitializeComponent();             this.DataContext = new Data();  ...

Reduce JavaScript source size

  Using the following GOOGLE application to reduce the JavaScript source size http://closure-compiler.appspot.com/home

Enable javascrip debug mode for SharePoint 2010

  Adding the following line into the web.config of SharePoint Site. <deployment retail= “false” />   , to the   system.web  section.

Microsoft SharePoint 2010, Application Development: Exam 70-573

http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-573#tab2 Skills Being MeasuredThis exam measures your ability to accomplish the technical tasks listed below.The percentages indicate the relative weight of each major topic area on the exam. Working with the SharePoint User Interface (19%) Manage SPSite and SPWeb programmatically by using Visual Studio 2010 This objective may include but is not limited to: creating sub webs, referencing SPFiles, manipulating property bag, when to call Update, referencing SPContext, SPSite, SPWeb,  SPSite.OpenWeb, SPWeb.Webs, feature activiation and deactivation This objective does not include: trivial cases such as setting title and other loose properties of the objects Implement a dialog by using the Dialog Framework This objective may include but is not limited to: Create dialogs from JavaScript or from server side, display dialogs Create a custom ribbon object This objective may include but is not limited to: adding custom actions ...

Everything about Workflows

SharePoint document workflow with Visual Studio workshop Part 1: Creating a basic SharePoint document workflow with Visual Studio + download Part 2: Introduction to custom ASP.NET forms (association forms) + download Part 3: Introduction to custom ASP.NET forms continued (instantiation/initialization forms) + download Part 4: Workflow tasks (taskedit form) + download SharePoint workflow: error updating a list item How to video: Building a multilevel approval workflow with SharePoint (MOSS 2007) and Visual Studio Workflow Gotcha – can’t use surveys Building workflow templates for SharePoint v3 using Visual Studio 2008 Workflow insights – correlation   Creating and Testing the project Extending the workflow: checking the amount and setting the status Extending the workflow: finding the manager and creating a custom activity Creating the tasks Creating and Using InfoPath Tasks Forms Using Several Task Forms Using association and initialization forms Bringing dat...

Deleting item in SharePoint List – Avoid memory leakage

/// <summary>         /// Deletes all the items from the specifid list. Uses batch processing for performance.         /// </summary>         /// <param name="site">The site that hosts the list.</param>         /// <param name="list">The name of the list that has the items to be deleted.</param>         public static void DeleteAllItems(string site, string list)         {             using (SPSite spSite = new SPSite(site))             {                 using (SPWeb spWeb = spSite.OpenWeb())             ...

Adding new Item into SharePoint List – Avoid the memory leakage

Never use SPList.Items.Add because this approach gets all items in the list before adding a new SPListItem.  Use the following method instead, which does not preload the list items:   private SPListItem OptimizedAddItem(SPList list)        {            const string EmptyQuery = "0";            SPQuery q = new SPQuery {Query = EmptyQuery};            return list.GetItems(q).Add();        }   Thanks ROB GARRETT for this trick http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/

HTML & XML encode for special characters

When working with SharePoint List Instance, List Definition, you meet some special character that display wrong on the Web page. Example: ü --> ¼c ö --> ä …. With HTML you can use HTML codes to fix ö --> &ouml; ü  --> &uuml;   In the XML content, the HTML codes will make schema not correct. so you need to use XML codes to fix this: ö --> &#246;   ü  --> &#252; You can use this page for HTML code: http://www.thesauruslex.com/typo/eng/enghtml.htm XML code: http://www.w3.org/TR/html4/sgml/entities.html#h-24.2

SharePoint 2010 CSS references in Master Pages

Ref: http://erikswenson.blogspot.com/2010/01/sharepoint-2010-css-references-in.html Here are some of the most common ways to reference your custom CSS for SharePoint 2010. One key change over 2007 is the ability to specify After=”corev4.css” in the CssRegistration to make sure your custom CSS is referenced after the OOTB corev4.css file. <SharePoint:CssLink runat="server" Version="4"/> Note: Default OOTB Output Order: <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/Themable/corev4.css"/> <SharePoint:Theme runat="server"/> Note: If a theme is enabled Output Order: <link rel=”stylesheet” type=”text/css” href=”/_themes/ [UniqueCounter#] /corev4- [u=UniqueHex#] .css?ctag= [UniqueCounter#] ”/> <SharePoint:CssRegistration name=”customfolder/samplecustom.css” runat=”server”/> Note: Alternate CSS on Server but comes before corev4.css Output Order: <link rel="styleshe...

Problem with TimerJob

1. Make sure the account running the SharePoint Timer service is the account which has the administrator Full Control permission over the site and the full permission over the content database. 2. Use Windows Explorer to open the 'Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\ <GUID>' folder. 3. Back up the .xml files and then delete the .xml files. 4. Open the Cache.ini file and then change the content of the Cache.ini setting to 1. 5. Click Start, point to Administrative Tools, and then click Services. 6. Restart the following Windows Services in the order shown: 1) Windows SharePoint Services Timer service. 2) Windows SharePoint Services Administration service. Thanks XI – BUNG – YU http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/4f1b3aaf-7173-4151-874b-5740bff4b14f

Anonymously accessing list items through the SharePoint Client Object Model

Image
p until today I haven't found time to explore the obscure corners of the SharePoint 2010 Client Object Model. Keeping an eye on my Twitter client, I noticed   Waldek Mastykarz   mention trying to use it in an anonymous portal context - and hitting an error doing so. Problems such as these easily catch my interest (that's my favorite way of learning new stuff), so I set out to try the same myself. I whipped up an empty SP2010 team site, created a dummy list and added an item to that. I then went on to create a simple SilverLight package, such as: public partial class MainPage : UserControl {     private ListItemCollection _items;     public MainPage()     {         InitializeComponent();         var context = new ClientContext(" http://sp10dev");      ...

Resource for SharePoint Site Definition

Deciding Between Custom Web Templates and Custom Site Definitions http://msdn.microsoft.com/en-us/library/aa979683.aspx How to: Create a Custom Site Definition and Configuration http://msdn.microsoft.com/en-us/library/ms454677.aspx Understanding Web*Temp.xml Files http://msdn.microsoft.com/en-us/library/ms447717.aspx Understanding Onet.xml Files http://msdn.microsoft.com/en-us/library/ms474369.aspx Customizing Site Navigation http://msdn.microsoft.com/en-us/library/ms471078.aspx How to: Create a Custom List Definition http://msdn.microsoft.com/en-us/library/ms466023.aspx Creating Content Types http://msdn.microsoft.com/en-us/library/ms479905.aspx How to: Add a Document Template, File Type, and Editing Application to a Site Definition http://msdn.microsoft.com/en-us/library/aa978104.aspx

Creating the Custom Activity for SharePoint Designer 2010

Image
  1. Introduction A workflow is a set of Actions that you want to do to resolve your business (Go to this link : http://office.microsoft.com/en-us/sharepointdesigner/HA101005871033.aspx). With Microsoft SharePoint Designer you can design workflows that add application logic to your site or application without having to write custom code. Using the Workflow Designer, you create the rules that associate conditions and actions with items in SharePoint lists or libraries, so that changes to items in list or libraries trigger action in the workflow. Ex.: You can design a workflow to automate the business process in you company like vacation request, leave office request….SharePoint Designer will help you create a workflow rapidly. But sometime, the default Actions that provided by SharePoint Designer is not enough or not adapt with business requirements like query user data from Active Directory, query data from other web site….To resolve this problem, you need to create custom ac...

Setup SharePoint 2010

  'Planning for Office 2010 & SharePoint Server 2010' at Microsoft's Launch 2010 Event in Washington, D.C. http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2010/05/19/planning-for-office-2010-amp-sharepoint-server-2010-at-microsoft-s-launch-2010-event-in-washington-d-c.aspx   'Deploying Office 2010 & SharePoint Server 2010' at Microsoft's Launch 2010 Event in Washington, D.C. http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2010/05/19/deploying-office-2010-amp-sharepoint-server-2010-at-microsoft-s-launch-2010-event-in-washington-d-c.aspx     'Configuring & Managing Office 2010 & SharePoint Server 2010' at Microsoft's Launch 2010 Event in Washington, D.C. http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2010/05/19/configuring-amp-managing-office-2010-amp-sharepoint-server-2010-at-microsoft-s-launch-2010-event-in-washington-d-c.aspx

SharePoint 2010 Resources

  With the official launch of SharePoint 2010 last week, we thought now would be a perfect time for us to share some resources to help you to get started evaluating and learning about the new release.  This post contains links to download evaluation software, guides, demo virtual machines and lots more, for both Developers and IT Professionals. 1. Check out the Office 2010 & SharePoint 2010 Launch Keynote and on-demand sessions , and the SharePoint 2010 Product Site on Microsoft.com 2. Download the SharePoint 2010 Overview Evaluation Guide , the SharePoint 2010 Professional Developer Evaluation Guide and the SharePoint 2010 IT Professionals Evaluation Guide to quickly ramp up on platform updates and additions. 3. Check out the learning plans for IT Professionals , Developers and End Users and get started on your SharePoint 2010 learning plan. 4. Download the pre-configured Hyper-V SharePoint 2010 Evaluation and Demo Virtual Machine (~1.8GB) along with the...

Glossary for SharePoint 2010

  Go to this link for  SharePoint 2010 glossary: http://msdn.microsoft.com/en-us/library/ee556558%28office.14%29.aspx or for SharePoint End Users http://www.rharbridge.com/?page_id=60&cpage=1#comment-73

Plan for permission inheritance

  Ref:  http://technet.microsoft.com/en-us/library/cc287752.aspx An example of Plan for Permission Inhertance It is much easier to manage permissions when there is a clear hierarchy of permissions and inherited permissions. It becomes more difficult when some lists within a site have fine-grained permissions applied, and when some sites have subsites with unique permissions and others with inherited permissions. For example, it is much easier to manage a site that has permission inheritance, as shown in the following table. Securable object Description Unique or inherited permissions SiteA Group home page Unique SiteA/SubsiteA Sensitive group Unique SiteA/SubsiteA/ListA ...

SharePoint Server 2010 Advanced IT Professional & Developer Trainings

  For IT professionals, SharePoint Server 2010 offers enhancements to drive productivity, a scalable unified infrastructure, and flexible deployment. SharePoint Server 2010 Advanced IT Professional Training is a deep technical learning series for current SharePoint Server 2007 professionals who are looking to upgrade their skills to SharePoint Server 2010. More information at http://technet.microsoft.com/hi-in/sharepoint/ff420396(en-us).aspx Each module also has downloadable options: 1) Core Architecture of SharePoint 2010 2) Security in SharePoint 2010 3) IT Pro Management in SharePoint 2010 4) Upgrading to SharePoint 2010 5) Enterprise Search in SharePoint 2010 6) Content Management in SharePoint 2010 7) Composite Solutions in SharePoint 2010 8) Communities in SharePoint 2010 9) Business Intelligence in SharePoint 2010 For developers, SharePoint 2010 provides a business collaboration platform to rapidly build solutions and respond to business needs. Shar...

SharePoint Server 2010 Trial Download

  Get the SharePoint Server 2010 download: http://technet.microsoft.com/en-us/evalcenter/ee388573.aspx Before install SharePoint 2010, please check your system to make sure SharePoint can run on your server: http://technet.microsoft.com/en-us/library/cc262485.aspx   There are four versions of SharePoint Server 2010: SharePoint Server 2010 Enterprise Client Access License features For organizations looking to expand their business collaboration platform to enable advanced scenarios. Use the Enterprise capabilities of SharePoint to fully interoperate with external line-of-business applications, Web services, and Microsoft Office client applications; make better decisions with rich data visualization, dashboards, and advanced analytics; and build robust forms and workflow-based solutions. SharePoint Server 2010 for Internet Sites, Enterprise For organizations looking to create customer-facing public internet sites and private extranets using ...

WebClient: Handling Cookies

  WebClient class is very useful when you need to download or upload date from or to the Web.  However, when you need to make a sequence of calls you find that WebClient does not preserve cookies set by the server between requests.  Fortunately, WebClient gives you an opportunity to handle cookies by yourself. The very simple solution is to override GetWebRequest method of the WebClient class and set CookieContainer property. Here is my implementation: public class CookieAwareWebClient : WebClient { private CookieContainer m_container = new CookieContainer (); protected override WebRequest GetWebRequest( Uri address) { WebRequest request = base .GetWebRequest(address); if (request is HttpWebRequest ) { (request as HttpWebRequest ).CookieContainer = m_container; } return request; } }

PEX – Unit Testing for SharePoint

  Pex and Moles are Visual Studio 2010 Power Tools that help Unit Testing .NET applications. Video Guide http://channel9.msdn.com/posts/matthijs/Pex-Unit-Testing-of-SharePoint-Services-that-Rocks/ (download link: http://ecn.channel9.msdn.com/o9/ch9/9/2/1/0/9/4/pex_2MB_ch9.wmv ) http://research.microsoft.com/en-us/projects/pex/ Document: http://research.microsoft.com/en-us/projects/pex/pexsharepoint.pdf

Implement Friendly URLs for SharePoint Blog Sites

Image
  Ref: http://blogs.pointbridge.com/Blogs/monnette_jeff/Pages/Post.aspx?_ID=27 Have you ever want to Rewriter URL for SharePoint. I am sure that is thing that you really want to do :). But there are not to much resources or guideline about this. I have found this topic via PointBridge.com, I did not implement for test it, but I think it will run well. ----------------------------------------------------- By default, SharePoint uses URLs like the following for the page that displays a post on a blog site: http://blogs.mycompany.com/blogs/blogger_name/lists/posts/post.aspx?ID=1 With a little code in an HTTP Module, we can support a much more user friendly URL format for displaying posts. In this example, I will show you how to create a module that implements URL rewriting and response filtering to support URLs that look like this instead: http://blogs.mycompany.com/blogs/blogger_name/1/blog_post_title Not only is this format more friendly to users but it can also incr...