Diagram below depicts how SharePoint Foundation is built on Microsoft .NET Framework 3.5, ASP.NET, and Internet Information Services (IIS). SharePoint is also built on SQL Server.
Friday, March 4, 2011
Tuesday, February 22, 2011
Visual Studio Productivity Tool–Latest Update Released
Today Microsoft has released latest update to Visual Studio Productivity Tools. This update includes many improvements, if you like to know more about it, read the following blogs:
- Document Well 2010 Plus
- Searchable Add Reference Dialog
- Quick Access Extension
- Copy Code in HTML format
Enjoy it!!
Visual Studio is SIMPLY THE BEST!!!
Saturday, February 19, 2011
Patterns & Practices SharePoint 2010 & 2007 Guidance Resources
Microsoft has released Patterns & Practices on SharePoint Guidance that are designed to help solution developers and architects make the right decisions and follow proven practices when building applications for SharePoint. The following are useful resources that you might want to explore:
Monday, February 14, 2011
SharePoint 2010 Official Site and Useful Blogs Worth Checking Out
A great starting place to understand more about SharePoint would be the MSDN SharePoint Developer Center:
You may also want to check out the MSDN Office Developer Center:
Also, Channel 9 offers a number of training kits that you can download and walk through, for both SharePoint and other Microsoft technologies. The Channel 9 Learning Center is located here:
With just these three sites, you’ll find a ton of developer resources.
Lastly, following are a few blogs worth checking out. You’ll certainly find more, but these have proven to be useful and informative over the years:
- SharePoint Team at http://blogs.msdn.com/sharepoint
- Andrew Connell at www.andrewconnell.com/blog
- Arpan Shah at http://blogs.msdn.com/arpans
- Paul Stubb at http://blogs.msdn.com/pstubbs
- Paul Andrew at http://blogs.msdn.com/pandrew
- Scot Hillier at www.shillier.com/default.aspx
- Sahil Malik at http://blah.winsmarts.com
- Wouter van Vugt at http://blogs.code-counsel.net/Wouter/default.aspx
- Todd Baginski at www.toddbaginski.com/blog
- Tim Heuer at http://timheuer.com/blog
- Steve Fox at http://blogs.msdn.com/steve_fox
SharePoint 2007 Common Customizations and Recommendations When Upgrading to SharePoint 2010
Because of the downtime issues, in-place upgrades are better suited for small environments. In larger environments, the downtime needed to do an in-place upgrade may be too long. In-place upgrades may also not be suited for environments with significant custom code or other customizations. One of the benefits of an in-place upgrade is that the customizations in SharePoint 2007 are maintained. However, in order for your upgrade to be successful, your custom code must run in both SharePoint 2007 and SharePoint 2010.
Table below provides list of common customizations in SharePoint 2007 and recommendations on how to deal with them when upgrading to SharePoint 2010:
| Customization | Good Choice | Better Choice |
| Custom Web Parts | Probably work out of the box with SharePoint 2010 | Test on sample server, plan to rewrite for SharePoint 2010 |
| Custom event handlers | Probably work out of the box with SharePoint 2010 | Test on sample server, plan to rewrite for SharePoint 2010 |
| Custom Site template | Create a site with the Custom Site template before upgrade | Recreate in SharePoint 2010, preferably as a Solution package and Feature |
| Custom site definition | Create UDF file for upgrade | Migrate to an out-of-the-box site template and deploy customizations as a Solution package and Feature |
| Customized (unghosted) | Reset to site definition | Reset to site definition, and reapply customizations |
| Custom code or pages in /_layouts | Probably work out of the box with SharePoint 2010 | Test on sample server, plan to rewrite for SharePoint 2010 |
Thursday, February 10, 2011
MSDN Virtual Lab: Introduction to Microsoft ASP.NET Web Forms 4.0
Today MSDN has released a newest Virtual Lab: Introduction to Microsoft ASP.NET Web Forms 4.0. Enjoy it!
Objectives
After completing this lab, you will be better able to:
- Take advantage of the new ASP.NET Project Templates
- Control server control ClientIds
- Enable bi-directional routing support
- Control the View State at application and page level
Scenario
ASP.NET 4 Web Forms provides enhancements in targeted areas and includes some new features. This Lab is also available online at http://channel9.msdn.com/learn and covers the following features:
New ASP.NET Project Templates
ASP.NET 4 Web Forms includes updated templates for creating new web applications and web sites. These templates include common functionality already implemented, which helps reducing the development time and provides guidance on best practices for building ASP.NET 4 Web applications.
Client IDs
Developers can now manage control IDs that affect rendered client IDs. The Control class now provides a new property called ClientIDMode that allows you to specify what behavior you want the runtime to take when determining whether or not to refactor the client ID upon rendering. This removes the previous bloat in the client ID.
URL Routing
ASP.NET 4 Web Forms introduces the new PageRouteHandler class that integrates URL Routing with Web Form Pages. URL routing in ASP.NET enables you to use URLs that do not have to map to specific files in a Web site. Because the URL does not have to map to a file, you can use URLs in a Web application that are descriptive of the user's action and are more easily understood by users and search engines. In URL routing, you define URL patterns that contain placeholders for values that are used when you handle URL requests. At run time, the pieces of the URL that follow the application name are parsed into discrete values, based on a URL pattern that you have defined.
View State
ASP.NET 4 Web Forms provides a more granular control over the View State. Developers can now disable the View State on a Page and enable it on specific server controls, and also disable it on a control an enable it on its childs.
Estimated time to complete
90 min
Computers used in this Lab
- VS2010Labs-PC
- The password for the Administrator account on all computers in this lab is: pass@word1
Tuesday, February 8, 2011
Getting SharePoint Web Application URL Using SPAlternateUrl
By using SPAlternateURL object, you can get the URL or SharePoint 2010 Web Application since the alternate access mappings are associated with a Web Application. Sample code is provided below:
public static string GetWebAppURL(SPWebApplication oWebApp, SPUrlZone urlZone)
{
string retVal = string.Empty;
try
{
foreach (SPAlternateUrl altUrl in oWebApp.AlternateUrls)
{
if (altUrl.UrlZone == urlZone)
{
retVal = altUrl.Uri.ToString();
break;
}
}
}
catch (Exception ex)
{
throw ex;
}
return retVal;
}
public static string GetWebAppURL(SPSite oSite, SPUrlZone urlZone)
{
string retVal = string.Empty;
SPWebApplication oWebApp = null;
try
{
if ((oWebApp = oSite.WebApplication) != null)
retVal = GetWebAppURL(oWebApp, urlZone);
}
catch (Exception ex)
{
throw ex;
}
return retVal;
}
public static string GetWebAppURL(SPWeb oWeb, SPUrlZone urlZone)
{
string retVal = string.Empty;
SPWebApplication oWebApp = null;
try
{
if(( oWebApp = oWeb.Site.WebApplication)!=null)
retVal = GetWebAppURL(oWebApp, urlZone);
}
catch (Exception ex)
{
throw ex;
}
return retVal;
}
In order to call these functions, you need to pass either SPWebApplication, SPSite or SPWeb object and specify the SPUrlZone enumeration which has the following originating zone of a request:
- Default - Specifies the default zone used for requests unless another zone is specified.
- Intranet - Specifies an intranet zone.
- Internet - Specifies an Internet zone.
- Custom - Specifies a custom zone.
- Extranet - Specifies an extranet zone.
Monday, February 7, 2011
How to Show Favicon In SharePoint 2010
Favicons are the little shortcut icons that appear in most modern browsers next to bookmarks, as well as in the address bar next to the site’s URL and on browser tabs - check out Wikipedia about Favicon.
SharePoint 2010 makes it very easy to add a favicon to custom master pages using the following code:
<SharePoint:SPShortcutIcon runat=”server” IconUrl=”/Style Library/Images/SPMalayaFavIcon.ico”/>
Please note that when testing favicons Internet Explorer, if you are having trouble seeing a new favicon and you are certain that the code and the image are set up correctly, it may help to clear your browser cache, make a new bookmark, or even close and
reopen the browser.
Hiding the Name.dll ActiveX Control
If you are working on a public-facing Internet site, you should be aware that SharePoint may show a particularly annoying message at the top of Internet Explorer like shown below (This website wants to run the following add-on: ‘Name ActiveX Control’ from ‘Microsoft Corporation’: If you trust the website and the add-on and want to allow it to run, click here…)
The message asks the user to run the Name.dll ActiveX Control add-on because the users don’t the SharePoint Server added to their trusted sites list. This control enables presence information to be displayed for authenticated users in SharePoint, and typically shows their availability in external Instant Messaging programs from inside SharePoint. Since anonymous users don’t really need this functionality you can turn off this message by using one of the following method:
- In SharePoint 2010 the message can be turned off from Central Administration –> Manage Web Applications –> General Settings. Simply set Enable the Person Names Smart Tag and Online Status for Members to No. This will turn off the presence information and remove the ActiveX message for the entire web application.
- Alternatively you can you can disable the message and functionality from a custom master page. Simply add the following code to your master page:
<script type=”text/javascript”>
function ProcessImn(){}
function ProcessImnMarkers(){}
</script>
This JavaScript code overrides the functions in SharePoint that cause this ActiveX message.
Sunday, February 6, 2011
SharePoint Guidance 2010 Hands On Lab Has Been Released
SharePoint Guidance 2010 Hands On Lab has just been released to CodePlex: http://spg.codeplex.com/
It consist of six labs:
- Add and Remove Application Setting in Feature Receiver and Retrieve them in Web Part
- Add and Remove Application Setting in Console Application and Use Hierarchy of them in Web Part
- Add, Update, Remove, Search Application Setting in Sandbox
- Read Application Setting in Sand Box Solution with ConfigProxy
- Register SharePoint Logger in Feature Receiver and Use Logger in Web Part
- Register Service in Feature Receiver and Display Service Instance in Web Part
Thursday, February 3, 2011
Random Number Generation - Not Random At All
using System;
namespace MyRandom
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
// Generate random number
Random random = new Random();
int myNum = random.Next(0, 10);
// Write generated random number to console window
Console.WriteLine("My random number: " + myNum.ToString());
}
// Pause running console window
Console.ReadLine();
}
}
}
Did you know that if you declared Random Class within the loop as shown in the code sample above, it will not generate random number at all – in fact it will generate same number as shown in the screenshot below:
To fix this problem, you need to declare Random Class outside of for loop as follows:
using System;
namespace MyRandom
{
class Program
{
static void Main(string[] args)
{
Random random = new Random();
for (int i = 0; i < 10; i++)
{
// Generate random number
int myNum = random.Next(0, 10);
// Write generated random number to console window
Console.WriteLine("My random number: " + myNum.ToString());
}
// Pause running console window
Console.ReadLine();
}
}
}
Windows Phone Training Kit Update Released
The Windows Phone Training Kit has been released today which includes few new labs – you can download Windows Phone 7 Training Kit for Developers here: RTM Refresh. The online training kit was also updated.
For more information, see: http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/02/02/windows-phone-training-kit-update.aspx
Using CrmDiscoveryService Web Service To Find Sales Org and Web Service End Point
Microsoft Dynamics CRM CrmDiscoveryService Web service provides a list of Web service endpoint URLs for each sales organization that you are a member of. The following sample code shows you how to use the Web service:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CRMDiscoveryServices;
using System.Configuration;
using System.Text;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
// Get CRM Dynamics credential from web configuration
string crmUserId = ConfigurationManager.AppSettings["CRMUSERID"];
string crmPassword = ConfigurationManager.AppSettings["CRMPASSWORD"];
string crmDomain = ConfigurationManager.AppSettings["CRMDOMAIN"];
// Create and configure the CrmDiscoveryService Web service proxy.
CrmDiscoveryService discoveryService = new CrmDiscoveryService();
discoveryService.Credentials = new System.Net.NetworkCredential(crmUserId, crmPassword, crmDomain);
// Retrieve the list of organizations that the logged on user belongs to.
RetrieveOrganizationsRequest orgRequest = new RetrieveOrganizationsRequest();
RetrieveOrganizationsResponse orgResponse = (RetrieveOrganizationsResponse)discoveryService.Execute(orgRequest);
// Locate the target organization in the list.
if (orgResponse != null && orgResponse.OrganizationDetails.Length > 0)
{
StringBuilder sb = new StringBuilder();
foreach (OrganizationDetail orgDetail in orgResponse.OrganizationDetails)
{
sb.AppendLine("<B>Organisation name:</B> " + orgDetail.OrganizationName
+ " <B>CRM Web application.:</B> " + orgDetail.WebApplicationUrl
+ " <B>CrmService Web service URL:</B> " + orgDetail.CrmServiceUrl + "<BR/>");
}
Response.Write(sb.ToString());
}
}
catch (Exception ex)
{
throw ex;
}
}
}
Please note that you need to add the CrmDiscoveryService web reference to your project. To add the web reference, select Add Service Reference, click Advanced, and then click Add Web Reference. In the URL field, paste the following string, replacing <server name> and <port number>:
http://<servername>:<port>/mscrmservices/2007/ad/crmdiscoveryservice.asmx?WSDL
Turn Off Warning Message On Unsupported Browsers in SharePoint 2010
Browser support in SharePoint 2010 has been greatly improved over SharePoint 2007, check out Technet’s Browser Support Matrix for SharePoint 2010. However Internet Explorer 6 (IE6) and other commonly used browsers are not browsers SharePoint 2010 supports from a content-authoring perspective. When you open a SharePoint page using IE6 browser, the following simple message will be displayed in the message box:
“Your Web browser will have problems displaying this web page. Changes to the sites may not function properly. For a better experience please update your browser to its latest version.”
Let say you are able to create a specific master page that works for anonymous IE6 users but how to turn off the warning message for all users with legacy unsupported browsers like IE6?
It’s simple! Find the following line at the bottom of the out-of-the-box master pages:
<SharePoint:WarnOnUnsupportedBrowsers runat=”server”/>
If you want to turn off the warning message for all users, you can simply remove it from master pages.
