Dynamics CRM 2011 Portal Development – Getting Started

Dynamics CRM 2011 Portal Development

Getting Started

1. Import solution from sdk\Solutions\PortalBase\MicrosoftXrmPortals_managed.zip. Detailed steps can be found Install the Base Portal Solution

The following navigation will be available in crm after import portal base solution

2. Create a new website, set the name of the website to “Hello World Portal

3. create a new Content Snippet, set the name of the snippet to “HelloWorld“, value to “Hello World!!!

4. Create a new empty web application in Visual Studio

5. Add reference to microsoft.xrm.client and microsoft.xrm.portal in sdk\bin\

6. Replace web.config with the following, change connectionString value

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="microsoft.xrm.client" type="Microsoft.Xrm.Client.Configuration.CrmSection, Microsoft.Xrm.Client"/>
        <section name="microsoft.xrm.portal" type="Microsoft.Xrm.Portal.Configuration.PortalCrmSection, Microsoft.Xrm.Portal"/>
    </configSections>
    <connectionStrings>
        <add name="Xrm" connectionString="ServiceUri=http://win-b1dmdctdenr/ :5555/Cleanup;"/>
    </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
            <expressionBuilders>
                <add expressionPrefix="Snippet" type="Microsoft.Xrm.Portal.Web.Compilation.SnippetExpressionBuilder, Microsoft.Xrm.Portal"/>
            </expressionBuilders>
        </compilation>
    </system.web>
    <microsoft.xrm.client>
        <contexts>
            <add name="Xrm" type="Microsoft.Xrm.Client.CrmOrganizationServiceContext, Microsoft.Xrm.Client"/>
        </contexts>
    </microsoft.xrm.client>
    <microsoft.xrm.portal>
        <portals>
            <add name="Hello World Portal"/>
        </portals>
    </microsoft.xrm.portal>
</configuration>

7. Add HelloWorld.aspx to the project and set as start page

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HelloWorld.aspx.cs" Inherits="HelloWorldPortal.HelloWorld" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml ">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h1><asp:Literal runat="server" Text="<%$ Snippet: HelloWorld %>" /></h1>
    </div>
    </form>
</body>
</html>

8. Debug web application, check result.

Advertisements

8 comments on “Dynamics CRM 2011 Portal Development – Getting Started

  1. Pingback: Dynamics CRM 2011 Portal Development – Snippet Expression | Zhongchen Zhou's Blog

  2. Pingback: Dynamics CRM 2011 Portal Development – CrmSiteMap Expression | Zhongchen Zhou's Blog

  3. Pingback: Dynamics CRM 2011 Portal Development – PortalContext Expression | Zhongchen Zhou's Blog

  4. Pingback: Dynamics CRM 2011 Portal Development – TimeZone Expression | Zhongchen Zhou's Blog

  5. Pingback: Dynamics CRM 2011 Portal Development | Zhongchen Zhou's Blog

  6. Pingback: Dynamics CRM 2011 Portal Development - Zhongchen Zhou's Dynamics CRM Tips, Tricks and Portal Development - CRM Technical Blogs - Microsoft Dynamics Community

  7. thanks for sharing portal development .
    I am getting error :-

    Could not load file or assembly ‘Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

    Source Error:

    Line 10:
    Line 11:
    Line 12: <asp:Literal ID="Literal1" runat="server" Text="” />
    Line 13:
    Line 14:
    ————————————
    Can you please help me in this.

    • To solve you error, you have to make sure to add microsoft.xrm.sdk as a reference, in addition to the references microsoft.xrm.client and microsoft.xrm.portal in sdk\bin\, mentioned above.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s