Tag Archives: ASP.NET

Reading from web.config’s AppSettings in a SharePoint timer job

csharpSharePoint-2013

Well, this was not as straight-forward as i first thought. Why? Because the timer job does not run in the same App Domain as the web application. They are in two separate processes : W3WP.EXE  and OWSTIMER.EXE for the Web Application worker process and the SharePoint timer respectively.

So, how do you go about it?

Well, firstly you need to add reference to your timer job as follows (unless your using VB !):

using System.Configuration;
using System.Web.Configuration;

Reading AppSettings in Timer

using (SPSite site = new SPSite(“http://SiteCollectionUrl"))

        {

            Configuration config = WebConfigurationManager.OpenWebConfiguration(“/”, site.WebApplication.Name);

            returnconfig.AppSettings.Settings[“AppSettingKeyToRead”].Value;

        }

Admittedly, this solution is hard coding the Uri of the Site Collection, but this is purely for demonstration purposes.

Get absolute URL to listitem’s default display form – Sharepoint2013

csharp

Problem : 

I need to have an absolute URL of a listitem’s display form – currently I do it the following way:

On http://mydomain.com/:

item.ParentList.ParentWeb.Url.TrimEnd('/') //"http://mydomain.com"
+ "/" 
+ item.ParentList.DefaultDisplayFormUrl.Trim('/')//"Lists/WorkflowTasks/DispForm.aspx"
+ "?ID=" + item.ID //"?ID=1"

This gets me the correct URL, meaning http://mydomain.com/Lists/WorkflowTasks/DispForm.aspx?ID=1.

However this fails when my site collection is on a slightly more sophisticated host url, for examplehttp://mydomain.com/sites/secondsite/ – both methods from my code return the url containing the “/sites/secondsite/ part so I end up with http://mydomain.com/sites/secondsite/sites/secondsite/Lists/etc

How do I code it in a more reliable way?

Solution :

There are a couple of methods for this available in the object model without the need to handle the slashes etc yourself, one method using MakeFullUrl:

var fullUrl = item.ParentList.ParentWeb.Site.MakeFullUrl(item.ParentList.DefaultDisplayFormUrl);

Also

+ "?ID=" + item.ID //"?ID=1"

Resolved.

10 Best Productivity Features in SharePoint 2013 – slideshare

SharePoint-2013

Slide from webinar. A walkthru of the Top 10 productivity features in SharePoint 2013. It explain why a productivity focus is important, and compelling reasons to move to SP2013.

Ref : slideshare

eDiscovery in SharePoint 2013 – An Introduction

SharePoint-2013

More and more organizations face more and more litigations. Whether they are shareholder lawsuits, fraud cases, or competitive investigations, litigation cases have proven to be costly, time consuming, and business disruptive. The new eDiscovery solution of SharePoint 2013 could really help organizations to lower eDiscovery costs, mitigate risks of data tempering or accidental deletion, and minimize business interruption.

In a series of blog articles I’ll show you the benefits of eDiscovery in SharePoint 2013, the architectural concept of the solution, some important implementation considerations, how to get eDiscovery to work technically in both an on-premises situation and in Office 365, and I’ll walk you through an eDiscovery case lifecycle.

But let’s start at the beginning:

What is eDiscovery?

Electronic discovery is the process to identify, preserve, search, process, and produce electronic content or electronically stored information (ESI) for a legal request or investigation.

Basically when we start a new eDiscovery case, we first want to look for possible relevant data, and make sure this data is not tampered with from that moment on (put it on hold). Next we would want to further refine the data set, do a legal review of this information, and then produce it for use in any legal investigation, compliance audit or policy enforcement in the organisation. Finally, when we are ready with the case, we wouldn’t want to forget to release the hold and formally close the case. In a diagram, this whole process would look as follows:

121813_1246_eDiscoveryi1

In SharePoint 2013 (and Exchange 2013), Microsoft did a major overhaul of their eDiscovery solution, resulting in a great tool to support this whole eDiscovery process, without disrupting regular business.

Benefits of using SharePoint 2013 for eDiscovery

With SharePoint 2013 it is possible to run an eDiscovery case on SharePoint, Exchange, Lync, and File Shares (on premises only) at the same time, from one unified central management console. That means it is possible to search, preserve (not for File Shares, we’ll get to that), and export all relevant content of all these repositories from one place.

In SharePoint 2010 it was already possible to perform an eDiscovery process, but this was only SharePoint content related. Exchange 2010 had its own eDiscovery tools. Also, when we would put a site on hold in SharePoint 2010, users would no longer be able to work on the contents of this site. So this was considered a rather business disruptive method.

In SharePoint 2013 these limitations are no longer there. Here’s an overview of what SharePoint 2013, together with Exchange 2013 and Lync 2013, can do for you when it comes to eDiscovery:

  1. SharePoint 2013 has new site templates for both an overall eDiscovery Center, and individual eDiscovery Cases. For every discovery case, you would create a new case site where it is possible to conduct searches, place content on hold, and export content. In addition, you can associate the following things with each case:
    1. Sources: Exchange mailboxes, SharePoint sites, or file shares from which content can be discovered.
    2. eDiscovery Sets: Combinations of sources, filters, and whether to preserve content. eDiscovery Sets are used to identify and preserve content.
    3. Queries: The search criteria, such as author, date range, and free-text terms, and the scope of the search. Queries are used to identify content to export.
    4. Exports: A list of all of the exports that were produced that relate to the case.
  2. With SharePoint 2013 it is possible to centralize eDiscovery management for multiple SharePoint farms, Exchange servers, and File shares. There are a few caveats here, which we will discuss in Part 2 of this blog series when we talk about architectural concepts and considerations (for example, it is not possible to centralize management for a hybrid environment with SharePoint on-premises and SharePoint Online), but as long as you can add a content source or result source to SharePoint Search, you can discover the content from one console.
  3. When you’ve created your eDiscovery Set and did a first general search for all possible relevant content, you probably want to put that content on hold before you start refining your searches and exporting the final content. You want to make sure that whatever happens with the content from that moment on, the original content stays available for your legal case. From the eDiscovery Center it is possible to put SharePoint 2013 sites and/or Exchange 2013 mailboxes on hold, without disrupting the business. End users shouldn’t be affected when content is put on hold and with SharePoint 2013, they’re not. As soon as a SharePoint 2013 site is put on hold, a hidden Document Library is created. Next, when a user modifies or deletes a content item subject to the legal hold, this is still possible for the user, but the original copy of the content item is copied to that hidden Hold Library. In Exchange 2013 mailboxes the same principle is applied by creating a hidden folder where items are actually moved to when a user deletes an item.
  4. From the SharePoint 2013 eDiscovery Center it is possible to export the results of a search for later import in another review tool. Together will all the exported content, an XML file is created which complies with the Electronic Discovery Reference Model (EDRM) specification. So when external (legal) teams use other tools that also comply with this standard, they can easily import the content and use their own tool for further review and analysis. The following content is included in an export:
    1. Documents: Documents are exported from file shares. Documents and their versions (optional) are exported from SharePoint.
    2. Lists: If a list item was included in the eDiscovery query results, the complete list is exported as a comma-separated values (.csv) file.
    3. Pages: SharePoint pages, such as wiki pages or blogs, are exported as MIME HTML (.mht) files, including styling and mark-up.
    4. Exchange objects: Items in an Exchange Server 2013 mailbox, such as tasks, calendar entries, contacts, email messages, and attachments, are exported as a .pst file.
  5. eDiscovery in SharePoint 2013 is rather quick to set up, and easy to use. Of course you need to do some configuration to get SharePoint and Exchange to work together, but this is fairly easy (as you’ll see in one of the next posts in this series). Also, because using the eDiscovery Center is very straightforward, there is no longer the need to burden the IT department with collecting all relevant content in the organization during an eDiscovery process. Legal teams can now be empowered to perform searches and exports themselves. They are able to respond quickly and in full fidelity with real-time data access. Of course there is the matter of governance here, how to handle the required permissions to be able to discover all relevant content, but that’s the case for IT people as well.

Summary

In this post I’ve tried to briefly explain the concept of eDiscovery and what a typical eDiscovery process would look like. Also, I’ve pointed out what’s new in SharePoint 2013 (and Exchange 2013) regarding eDiscovery and how the new eDiscovery Center could really help organizations to quickly respond to cases without disrupting business as usual.

In the next few blog posts I’ll dive more into the architectural concepts of Microsoft’s eDiscovery solution, I’ll talk about some important implementation considerations, how to get eDiscovery to work technically in both an on-premises situation and in Office 365, and I’ll walk you through an eDiscovery case lifecycle.

Ref : eekels

Free SharePoint 2013 eBooks

SharePoint-2013

Looking for new and free SharePoint reference books? This eBook collection will certainly satisfy your appetite for improvement in SharePoint technology field. There’s plenty of valuable tutorials here to keep you busy reading for a while. Be sure to grab few of these eBooks, check more related goodies at the bottom and don’t forget to tell us what you think.

SharePoint 2013 WCM Advanced Cookbook

Buy the paper bookSharePoint 2013 Server includes new and improved features for web content management that simplify how you design publishing sites, and enhances the authoring and publishing processes of organizations.

With SharePoint 2013 WCM Advanced Cookbook, you will learn about a full-fledged web content management system using Microsoft SharePoint Server 2013.

Publisher: Packt Publishing

By: John Chapman

Published Year: 2014
Pages: 436
Download PDF (7 MB)
Buy the paper book version


SharePoint 2013 Branding and User Interface Design

Buy the paper bookIf you are planning, designing, and launching your brand using SharePoint, this book and author trio will walk you through everything you need to know in an understandable and approachable way.
This visual book provides step-by-step instructions in a simple and striking format that focuses on each of the tasks you will face in your own branding project.

Publisher: Wrox
By: Randy Drisgill, John Ross, Paul Stubbs
Published Year: 2013
Pages: 432
Download PDF (54 MB)
Buy the paper book version


Pro SharePoint 2013 App Development

Buy the paper bookUsing step-by-step tutorials, author Steve Wright creates a sample SharePoint app throughout the course of the book, and you can walk with him through the entire lifecycle of a SharePoint app.

Publisher: Apress
By: Steve Wright
Published Year: 2013
Pages: 432
Download PDF (15.5 MB)
Buy the paper book version


Microsoft SharePoint 2013 App Development

Buy the paper bookLed by two SharePoint experts, you’ll learn development techniques such as building app lists, creating event handlers, and the major classes in the object model that provide access to content stored in SharePoint.

Publisher: Microsoft Press
By: Scot Hillier, Ted Pattison
Published Year: 2013
Pages: 202
Download PDF (34 MB)
Buy the paper book version


Pro SharePoint 2013 Branding and Responsive Web Development

Buy the paper bookPro SharePoint 2013 Branding and Responsive Web Development is the definitive reference on the technologies, tools, and techniques needed for building responsive websites and applications with SharePoint 2013. The book focuses on solutions that provide the best browser experience for the myriad of devices, browsers, and screen orientations and resolutions.

Publisher: Apress
By: Eric Overfield, Rita Zhang, Oscar Medina, Kanwal Khipple
Published Year: 2013
Pages: 580
Download PDF (26 MB)
Buy the paper book version


Microsoft SharePoint 2013: Designing and Architecting Solutions

Buy the paper bookDetermine the best design for your SharePoint implementation by gaining a deeper understanding of how the platform works. Written by a team of SharePoint experts, this practical guide introduces the Microsoft SharePoint 2013 architecture, and walks you through design considerations for planning and building a custom SharePoint solution. It’s ideal for IT professionals, whether or not you have experience with previous versions of SharePoint.

Publisher: Microsoft Press
By: Shannon Bray, Miguel Wood, Patrick Curran
Published Year: 2013
Pages: 488
Download PDF (55 MB)
Buy the paper book version


SharePoint 2013 User’s Guide, 4th Edition

Buy the paper bookMicrosoft SharePoint 2013 provides a collection of tools and services you can use to improve user and team productivity, make information sharing more effective, and facilitate business decision–making processes. In order to get the most out of SharePoint 2013, you need to understand how to best use the capabilities to support your information management, collaboration, and business process management needs. The SharePoint 2013 User’s Guide is designed to provide you with the information you need to effectively use these tools.

Publisher: Apress
By: Anthony Smith
Published Year: 2013
Pages: 536
Download PDF (53 MB)
Buy the paper book version


Microsoft SharePoint 2013 Inside Out

Buy the paper bookYou’re beyond the basics, so dive right into SharePoint 2013—and really put your business collaboration platform to work! This supremely organized reference packs hundreds of timesaving solutions, troubleshooting techniques, and workarounds. It’s all muscle and no fluff. Discover how the experts facilitate information sharing across the enterprise—and challenge yourself to new levels of mastery.

Publisher: Microsoft Press
By: Darvish Shadravan, Penelope Coventry, Thomas Resing, Christina Wheeler
Published Year: 2013
Pages: 904
Download PDF (124 MB)
Buy the paper book version


Pro SharePoint 2013 Administration, 2nd Edition

Buy the paper bookPro SharePoint 2013 Administration is a practical guide to SharePoint 2013 for intermediate to advanced SharePoint administrators and power users, covering the out-of-the-box feature set and capabilities of Microsoft’s collaboration and business productivity platform.

Publisher: Apress
By: Robert Garrett
Published Year: 2013
Pages: 655
Download PDF (32 MB)
Buy the paper book version


Professional SharePoint 2013 Administration

Buy the paper bookThe new iteration of SharePoint boasts exciting new features. However, any new version also comes with its fair share of challenges and that’s where this book comes in. The team of SharePoint admin gurus returns to presents a fully updated resource that prepares you for making all the new SharePoint 2013 features work right. They cover all of the administration components of SharePoint 2013 in detail, and present a clear understanding of how they affect the role of the administrator.

Publisher: Wrox
By: Shane Young, Steve Caravajal, Todd Klindt
Published Year: 2013
Pages: 840
Download PDF (56 MB)
Buy the paper book version


Practical SharePoint 2010 Branding and Customization

Buy the paper bookWith Practical SharePoint 2010 Branding and Customization, SharePoint branding expert Erik Swenson cuts through the fluff and discusses accessible, easy-to-understand consulting and processes to create aesthetically pleasing, highly usable branded and customized SharePoint websites, both internally and externally. Designed to be a quick reference, how-to guide that lets you dive straight into the task at hand, you’ll find this book’s attention to detail and pragmatism make it an attractive companion during your branding experience.

Publisher: Apress
By: Erik Swenson
Published Year: 2013
Pages: 368
Download PDF (7 MB)
Buy the paper book version


Professional SharePoint 2013 Development

Buy the paper bookA team of well-known Microsoft MVPs joins forces in this fully updated resource, providing you with in-depth coverage of development tools in the latest iteration of the immensely popular SharePoint. From building solutions to building custom workflow and content management applications, this book shares field-tested best practices on all aspect of SharePoint 2013 development.

Publisher: Wrox
By: Reza Alirezaei, Brendon Schwartz, Matt Ranlett, Scot Hillier, Brian Wilson, Jeff Fried, Paul Swider
Published Year: 2013
Pages: 816
Download PDF (47 MB)
Buy the paper book version


Exploring Microsoft SharePoint 2013

Buy the paper bookYour guide to the most significant changes in SharePoint 2013. Discover what’s new and what’s changed in SharePoint 2013—and get a head start using these cutting-edge capabilities to improve organizational collaboration and effectiveness.

Led by a Microsoft MVP for SharePoint, you’ll learn how to take advantage of important new features and functionality, including app development, collaborative social enterprise tools, enhanced versioning, themes, improved search, and an extended client object model.

Publisher: Microsoft Press
By: Penelope Coventry
Published Year: 2013
Pages: 200
Download PDF (17 MB)
Buy the paper book version


SharePoint 2013 For Dummies

Buy the paper bookSharePoint Portal Server is an essential part of the enterprise infrastructure for many businesses. Building on the success of previous versions of SharePoint For Dummies, this new edition covers all the latest features of SharePoint 2013 and provides you with an easy-to-understand resource for making the most of all that this version has to offer. You’ll learn how to get a site up and running, branded, and populated with content, workflow, and management. In addition, this new edition includes essential need-to-know information for administrators, techsumers, and page admins who want to leverage the cloud-hosted features online, either as a standalone product or in conjunction with an existing SharePoint infrastructure.

Publisher: Wiley
By: Ken Withee
Published Year: 2013
Pages: 384
Download PDF (32 MB)
Buy the paper book version

If you are unable to download email me

Ref : topsharepoint

New Best Practices for SharePoint 2013 Farm Design – Streamlined Topology

Microsoft some time back released “Streamlined Topology for SharePoint 2013”, new way to build & configure SharePoint 2013 farm. It’s really nice to see official documentation on new approach which I had first heard at SPC12 during SPC119 “Designing Your SharePoint Server 2013 Enterprise Deployment” Session. In that session Luca Bandinelli delivered prescriptive guidance to build SharePoint 2013 On-Premises farm similar to SharePoint Online based on Microsoft’s lessons learned and best practices while maintaining and building their own SharePoint online data centers.

As far as Physical Topology, We have three tiered approach since MOSS 2007 days. In MOSS 2007, we had Web Tier, Application Tier (Central Admin, Shared Service Providers – Search, Excel, Profile Import), and Database Tier. In SharePoint 2010, there wasn’t much changed and we had almost same 3-tier topology (except Application Tier dedicated for Service Applications instead of SSP) but dedicated servers can be added in application tiers for high preformat service applications like Search or PerformancePoint etc.

With SharePoint 2013, we had lot more service applications and many of these service applications can be grouped in similar groups either based on their CPU and RAM needs or either based on their latency, throughput, or workloads/resource utilization to optimize system resources and maximize performance for users. Even though we can get away with traditional 3-tier topology approach in SharePoint 2013, there are some new services may require additional tier and dedicated attention on Application tier. All the windows & WCF services can be divided into – very low, low, and high tolerant latency and this may require us dividing up application tier in multiple tiers for each type of latency tolerant service applications.

As shown in the diagram below, Microsoft provides us alternative farm design topology by redefining traditional web and application tier into multiple tiers.sp2013-traditional-to-streamlined-model1

sp2013-server-roles

Traditional webtier is redefined as Caching and Request Processing tier which would group similar web front end servers forend user request processing along with new service applications like Request Management and Distributed Cache which would require very low latency but very high throughout. Request Management is disabled by default and Distributed Cache is enabled by default. Since Request Manager is CPU intensive and Distributed Cache is memory intensive, both of these services can share same server without any major performance hit.

  • Traditional Application tier is divided into two optimized tiers – Front End Servers and Batch Processing Servers.
    • Front-End Servers would group similar service applications which would serve user requests with low latency, low resource utilization, and optimized for faster performance and response time. Services like Central Administration, Managed Metadata, User Profile, App Management, Search Query Role, and Business Data Connectivity are ideal for Front End Servers.
    • Batch Processing Servers would group similar service applications which would typically require long running back ground processes, high latency, and high resource utilization, and optimized for higher workload by maximizing system resources. Services like User Profile Sync, Work Management, Search Crawl and Index Role, Workflow, Machine Translation etc. are ideal for Batch Processing Servers. For large scale farms, Batch processing tier can be divided further into specialized load servers for services like Search, PerformancePoint, or Excel Services which can cause high spikes in performance during peak time.
    • Database tier stays same in both traditional and streamlined model. These servers can be either clustered, mirrored, or configured with Always On.

 

Ok, So, What’s your take on this new Model..

Having said that, my take on this new approach is what I used to say while designing SharePoint 2010 topologies. Even though you would ideally love to plan for 4-5 tier topology, it may not be possible in real world due to possible hardware funding issues. You are looking at nearly 10 high performing virtual machines or physical hardware, which may be daunting to get through budget approval  process.

Depending on your situation, number of users, and size of farm, you may get away with running traditional three tiered approach as long as they have enough hardware resources like RAM and CPU allocated. With the traditional 3-tier approach, you can run Distributed Cache and Request Management on Web Servers, Central Admin and all the Service applications in Application tier as initial farm design and plan to scale out or add more dedicated servers for specific workloads like Search as needed.

Resources

SharePoint 2010: Error 7043

SharePoint 2010: Error 7043 “Load control template file /_controltemplates/TaxonomyPicker.ascx failed”

SUMMARY

You install Microsoft Sharepoint 2010 RTM on Windows 2008 R2, you receive the following error message multiple times in the application event log:
Event Type: Error
Event Source: SharePoint Foundation
Event Category: None
Event ID: 7043
Computer: SERVERNAME
Description: Load control template file /_controltemplates/TaxonomyPicker.ascx failed: Could not load type ‘Microsoft.SharePoint.Portal.WebControls.TaxonomyPicker’ from assembly ‘Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’.

CAUSE
The ULS log is created in a code path where all control templates are loaded into the web application. This is a one time process which happens just before showing any UI to the user after an IISReset.
The source of the problem looks like a stale control template in the control templates folder while the control itself has been removed from the code base.

RESOLUTION
This is not causing any issues except for a wrong ULS log message a single time in a web application process life time, the exception is caught and that template file is skipped. This message should be treated as log noise and can be ignored.
To change this behavior:

  1. Navigate to /14/TEMPLATE/ControlTemplates/TaxonomyPicker.ascx user control
  2. Open the user control in a text editor and locate the first line
  3. Find the character string , and replace with a comma ‘,’ (without quotes).
  4. Save the user control

Jquery datepicker problem on date select in IE – ‘length’ is null or not an object

I am posting a wonderful post on Jquery datepicker.
Because I am using Jquery in ASP.NET application, I added a regular expression for date to validate whether user entered date is valid or not. Because of adding the validation on the text box, whenever I select a date from datepicker, the datepicker events are firing like onselect, change etc.. So, generally what validation framework is doing, whenever some event fires on the page, validations will execute. The same thing happening here. Whenever I change or select date from the date picker, it will fire some events and at the same time validation framework trying to validate the validations. But, it is not the right event to do validations. So, always we will get the exception at “vals.length” in a for loop of the built-in code. vals is the object of all the validators on the page. It always fails to load in Jquery date picker event trigger, because it is not the right event for validation. And the result is vals is undefined, you always get exception at vals.length as “length is null or not an object”. I think now you got very clear idea of why it is happening. Now, move to the next step i.e. solution for it.

Solution is very simple, I read all the documentation of Jquery datepicker and found an event named onSelect. So, whenever I select date this is the event firing. So, there I got a clue and started thinking towards it. And below is the result.

$(“.datepicker”).datepicker({ onSelect:function(){}});

In your datepicker initialization statement add onSelect event which don’t do anything means empty function as shown above. There problem solved. Isn’t a good find? Please let me know your thoughts on this.

Ref : praveenbattula

Anchor tags not working in firefox

Here is the simple issue fixed when working with HTML. This is kind of a browser compatibility issue.

In my SharePoint page we have created a CEWP and placed some HTML code along with anchor tag bookmarks features.

But Book marks is working fine in I-Explorer and not working in Firefox.

This got fixed by removing the “#” from the name of the Div tag name of the Bookmark.

Avoid Multiple Logins in SharePoint

When using SharePoint, you may be asked to provide your user name and password multiple times.

If you are on the domain, use Internet Explorer or Firefox, and run Microsoft Windows. You can configure your browser to use your current Windows user name and password, thereby eliminating the problem of multiple logins.

To configure Internet Explorer

  1. Open Microsoft Internet Explorer (IE).
  2. Log on to your SharePoint site.
  3. In IE, select the Tools menu, then select Internet Options.
  4. Select the Security tab.
  5. Select Local intranet, then click the Sites button.
  6. Click the Advanced button.
  7. The Web address of your SharePoint site should appear in the Add this website to the zone field. Click the Add button, then the Close button.
  8. Click OK to close the remaining dialog boxes.

To configure Firefox

  1. Open Firefox.
  2. In the address bar, type about:config and press Enter.
  3. When prompted with a warning, select I’ll be careful, I promise!
  4. Scroll to the preference named yoursiteurlpreference.
  5. Right-click on this preference and select Modify.
  6. In the Enter string value dialog box type https://YoursiteURL/ and clickOK.