Windows 2012 Hosting - MVC 6 and SQL 2014 BLOG

Tutorial and Articles about Windows Hosting, SQL Hosting, MVC Hosting, and Silverlight Hosting

Community Server Hosting - ASPHostPortal :: Integrating SharePoint Server 2007 with Community Server Membership Databases

clock June 16, 2010 10:22 by author Jervis

This article describes Integrating SharePoint Server 2007 with Community Server Membership Databases. If you’re looking for Community Server and MOSS, you can always consider ASPHostPortal as the alternatives. We give our best for you.

Getting Started

Community Server uses the membership and role providers in ASP.NET. ASP.NET includes the System.Web.Security.SqlMembershipProvider class and the System.Web.Security.SqlRoleProvider class. These classes communicate with an ASP.NET membership database that is usually created by using the command-line tool, aspnet_regsql.exe.

Modifying ASP.NET Web.config Files

Locate the web.config file of the SharePoint site that you want to use forms-based authentication. By default, the path of this file is the following: local_drive:\inetpub\wwwroot\wss\VirtualDirectories\80.

Next, locate the web.config file for SharePoint Central Administration.

To locate the webconfig file for SharePoint Central Administration

1. At a command prompt, type inetmgr to launch Internet Information Services (IIS).

2. In IIS, expand the node computer_name (local computer).

3. Expand Web Sites.

4. Right-click SharePoint Central Administration, and then click Properties.

5. Click Home Directory.

6. Under Local Path, note the location of the web.config file. For example,
local_drive:\inetpub\wwwroot\wss\VirtualDirectories\7552.

The number, 7552 in this example, indicates the port number on which this site runs.

After locating these two web.config files, add the following XML to both files immediately after the <SharePoint> section and before the <system.web> section. If there is already a <connectionString> section, insert the <add> element contents to the existing section. The following XML example points to a database located on the local computer. The database instance runs on Microsoft SQL Server 2005 Express Edition (MSDE).

  <connectionStrings>

    <add name="AspNetSqlProvider" connectionString="Data Source=.\SQLEXPRESS;database=CommunityServer;Trusted_Connection=True" />

  </connectionStrings>

The following example shows how to point to a database on a remote computer.

<add name="AspNetSqlProvider" connectionString="Data server=myRemoteServerName;database=

  CommunityServer;Trusted_Connection=True" />

Next, add the following XML to the <system.web> section of the web.config file of the SharePoint site.

<membership defaultProvider="AspNetSqlMembershipProvider">

      <providers>

        <remove name="AspNetSqlMembershipProvider" />

        <add connectionStringName="AspNetSqlProvider"

passwordAttemptWindow="10"

           enablePasswordRetrieval="false" enablePasswordReset="true"

           requiresQuestionAndAnswer="true" applicationName="Community_Server_application_instance"

           requiresUniqueEmail="false" passwordFormat="Hashed"

           description="Stores and retrieves membership data from the SQL Server database"

           name="AspNetSqlMembershipProvider" type=

             "System.Web.Security.SqlMembershipProvider,

           System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

      </providers>

    </membership>

 

    <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">

      <providers>

        <remove name="AspNetSqlRoleProvider" />

        <add connectionStringName="AspNetSqlProvider" applicationName=" Community_Server_application_instance "

           description="Stores and retrieves role data from the local SQL Server database"

           name="AspNetSqlRoleProvider" type=

             "System.Web.Security.SqlRoleProvider,

           System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

      </providers>

    </roleManager>

Add the following XML to the <system.web> section of the web.config file of SharePoint Central Administration.

<membership defaultProvider="AspNetSqlMembershipProvider">

      <providers>

        <remove name="AspNetSqlMembershipProvider" />

        <add connectionStringName="AspNetSqlProvider" passwordAttemptWindow="10"

           enablePasswordRetrieval="false" enablePasswordReset="true"

           requiresQuestionAndAnswer="true" applicationName="Community_Server_application_instance"

           requiresUniqueEmail="false" passwordFormat="Hashed"

           description="Stores and retrieves membership data from the SQL Server database"

           name="AspNetSqlMembershipProvider" type=

             "System.Web.Security.SqlMembershipProvider,

           System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

      </providers>

    </membership>

 

    <roleManager enabled="true" defaultProvider=

      "AspNetWindowsTokenRoleProvider">

      <providers>

        <remove name="AspNetSqlRoleProvider" />

        <add connectionStringName="AspNetSqlProvider" applicationName="Community_Server_application_instance"

           description="Stores and retrieves roles data from the local Microsoft SQL Server database"

           name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider,

           System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=

             b03f5f7f11d50a3a" />

      </providers>

    </roleManager>

Community_Server_application_instance is the name of the Application instance for Community Server. By default, this is usually "dev".

To determine the Community_Server_application_instance name

1. In Community Server, start SQL Server Management Studio and examine the aspnet_Applications table.

2. From the ApplicationName column, select the appropriate application name.

The only difference between the two code examples is the defaultProvider for role manager. This ensures that we can continue to use Windows authentication for SharePoint Central Administration but make Community Server Users discoverable in the People Picker control for the SharePoint site.

After you save the files, you must reset IIS. To do so, in a Command Prompt window, type IISRESET /RESTART.

Enabling Forms-Based Authentication on Windows SharePoint Services

The next step is to enable forms-based authentication for the SharePoint site by using SharePoint Central Administration.

To enable forms-based authentication

1. Click Start, point to All Programs, point to Microsoft Office Server, and then click SharePoint 3.0 Central Administration.

2. Click Application Management.

3. In the Application Security section, click Authentication Providers.

4. Under Zone, click Default.

5. Choose Forms.

6. In the text boxes, type the MembershipProvider (typically AspNetSqlMembershipProvider) and RoleProviders (typically AspNetSqlRoleProvider), defined in the Membership and Role Manager sections respectively in the XML above, and then click Save.

When you save the changes, Windows SharePoint Services automatically adds an Authentication section to the web.config file for the SharePoint site indicating to IIS to use forms-based authentication instead of the default Windows authentication.

Adding a Community Server Administrator to the SharePoint Site

Next, we add a Community Server administrator to manage the SharePoint site. If there is not one already, create a user in the Community Server site to act as the administrator for the SharePoint site. The user does not have to have any special roles defined. We used the built-in Community Server Admin account.

To add a Community Server Administrator to the SharePoint site

1. Click Start, point to All Programs, point to Microsoft Office Server, and then click SharePoint 3.0 Central Administration.

2. Click Application Management.

3. In the Application Security section, click Policy for Web application.

4. In the list of Web applications, select the Web application on which you want to operate.

5. Click Add Users.

6. From the Zone list, select Default, and then click Next.

7. In the Users box, type the user name of the administrator account that you created in Community Server.

8. Press Enter or click the check box to resolve the user. If the user name does not resolve, check the web.config settings and connectionString values.

9. After the name resolves, select Full control, and then click Finish.

Adding Community Server Roles to SharePoint Security Groups

Adding individual users to SharePoint security groups manually is time-consuming and creates unnecessary and redundant overhead for site administrators because typically there is already a security group that defines a set of users. The latest release of SharePoint Products and Technologies treat ASP.NET roles as security groups. For example, we can add the Community Server "Registered Users" role to the "Home Visitors" group of the SharePoint site. This assigns any member of the Community Server "Registered Users" role to the "Home Visitors" group. Members of the "Registered Users" role would then have read and view access to the SharePoint site.

To grant access for Community Server users to the SharePoint site

1. In Internet Explorer, browse to the SharePoint site.

2. Log on to the SharePoint site by using the Community Server account to which you assigned full control: the "admin" account with the password assigned to it.

3. Type the user name and password for the administrator account.

4. Click Site Actions.

5. Click Site Settings and then click People and Groups.

6. In the list of security groups, select Home Visitors.

7. Click New.

8. In the Users text box, type Registered Users and then press Enter.

9. After the name resolves, click OK.

10. Test the access with a Community Server user account from the "Registered Users" role. Log on to the SharePoint site. You should see the read-only version of the SharePoint site.

Conclusion

Community Server is a great example of software that is built on top of the ASP.NET flexible membership services. The ASP.NET membership services enables their software to easily interoperate with other products that also use membership services, in this particular case SharePoint Server 2007. The ASP.NET RoleProvider model abstracts Role assignments away from the IT department and to someone closer to this task, so that the IT department can focus on larger issues.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they're really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization - as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal's top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients' critical sites and services.

 



Community Server Hosting - ASPHostPortal :: Using Override Files

clock June 4, 2010 04:40 by author Jervis

This topic contains brief information about Using Override Files. If you looking for Community Server hosting, you can always consider ASPHostPortal. At ASPHostPortal you can get a professional Community Server installation with your Community Server Hosting account. You can always start from our Portal ONE hosting plan (from @$5.00/month) to get this application installed on your website. So, why wait longer?

Override files allow you to modify any aspect of a communityserver.config or siteurls.config file without modifying the original .config file that ships with Community Server or Evolution. In this article, we will modify the HTML scrubber portion of the communityserver.config file using a communityserver_override.config file.


Why Should I use Override Files?

The main benefit of using override files to make changes to the core configuration files is that you are not actually modifying the core configuration files. Instead, you are making the modifications through a separate configuration file.  This means that when you upgrade Community Server, the changes you have made will not be destroyed if the upgrade comes with new  versions of the core configuration files.

The Override File

An override file is just another xml file. The basic structure of an override file goes as follows:

<?xml version="1.0" encoding="utf-8">

<Overrides>
  <!-- Overrides go here -->

</Overrides>

The override file should go into the root folder of your website, i.e., in the same location as the existing communityserver.config file. If you are overriding siteurls.config, you should name it siteurls_override.config, and similarly you should rename the communityserver.config something like communityserver_override.config.

Overrides

An override file contains a collection of overrides.  Each override must have two attributes specified on it: xpath and mode.

The xpath attribute is the XPath to the node (or attribute) of the configuration file you want to manipulate with the override.  Briefly put, the XPath is a path to specific nodes in the core configuration file. You will see some example XPaths throughout this article.

Overrides can use the following modes:
- Remove - Deletes a node or attribute.
- Update - Used to change an entire xml node.
- Add - Adds a node (or nodes) either before, after or within the specified node.
- Change - Used to change the value of an attribute.
- New - Used to create a new attribute with the specified value.

Remove

Use the remove option to remove a whole node or a single attribute from the configuration file.  For example, you may decide you don't want to allow your users to specify css classes for the content they generated. To do this you can use the following override to remove class from the list of allowed global attributes:

<Override xpath="/CommunityServer/MarkUp/globalAttributes/class"
          mode="remove" />

Similarly you may decide that you do not want users to be able to specify the color used with font tags. To remove a specific attribute you must specify the name of the attribute to remove the following:

<Override xpath="/CommunityServer/MarkUp/html/font"
          mode="remove" name="color" />


Update

The update mode allows you to totally replace a node in the original configuration file. This is particularly useful if you are making so many changes to the original node that it is simpler to replace the whole node.  For example, if you want to allow users to only use an very small subset of html when posting (bold, italic, paragraphs and line breaks), you can use the following override:

<Override xpath="/CommunityServer/MarkUp/html" mode="update">
  <html>
    <strong />
    <em />
    <p />
    <br />
  </html>
</Override>

Add

The add mode allows you to add additional nodes to the original configuration file.  With add overrides, you can specify a where attribute to specify where the overrides should be added. The following values can be used for the where attributes.

- before - This adds the nodes within the override before the node specified in the XPath.
- after- This adds the nodes within the override after the node specified in the XPath.
- start - adds the nodes within the override at the beginning of the node specified in the XPath.
- end - adds the nodes within the override at the end of the node specified in the XPath.

If no value is specified for where, the start behaviour is used.

To better illustrate the difference between what different wheres do, take the following overrides:

<Override xpath="/CommunityServer/MarkUp/html/" mode="add"
          where="before" >
  <Before />
</Override>
<Override xpath="/CommunityServer/MarkUp/html/" mode="add"
          where="after" >
  <After />
</Override>
<Override xpath="/CommunityServer/MarkUp/html/" mode="add"
          where="start" >
  <Start />
</Override>
<Override xpath="/CommunityServer/MarkUp/html/" mode="add"
          where="end" >
  <End />
</Override>
<Override xpath="/CommunityServer/MarkUp/html/" mode="add"
          where="" >
  <Unspecified />
</Override>

Change

The change mode allows you to change the value of a specific attribute on an xml node.  When using the change mode, you must specify two additional attributes on the override

- name - the name of the attribute you want to change
- value - the new value you want the attribute to have.

For example, you can use the following override to disallow the colour attribute from being used with the font html element in user-generated content.


<Override xpath="/CommunityServer/MarkUp/html/font" mode="change"
          name="color" value="false" />

New

The new mode allows you to add a new attribute to an xml node. Like the change mode, you must specify two additional attributes on your override:

- name - the name of the attribute you want to add
- value - the value you want the attribute to have

For example, you can allow the type attribute to be specified on ordered lists by using the following override:


<Override xpath="/CommunityServer/MarkUp/html/ol" mode="new"
          name="type" value="true" />

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they're really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization - as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal's top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients' critical sites and services.

 



Community Server Hosting - ASPHostPortal :: How to Implement Custom Widgets

clock May 31, 2010 08:25 by author Jervis

Widgets in Community Server 2008 (internally identified as content fragments) are server-side .net classes implementing the CommunityServer.Components.IContentFragment interface.  Community Server will load all classes implementing this interface from all assemblies in the bin/ folder and make them available in the widget selection form (subject to application-type filters) -- there is no additional configuration required to add support for new content fragment types. For more information, visit http://www.asphostportal.com.

To help implement new content fragments, CS2008 includes two base classes: 
CommunityServer.Components.ContentFragmentBase and CommunityServer.Components.ConfigurableContentFragmentBase.  These base classes implement the administrative members of the IContentFragment interface and require that only the content-related members be implemented to complete a new content fragment.  Furthermore, the ConfigurableContentFragmentBase base-class adds support for exposing configuration options (via Dynamic Configuration) for new content fragments.

Implementing a Basic Widget

A basic widget is very easy to implement.  Simply create a new class library project in Visual Studio and add a reference to CommunityServer.Components.dll and System.Web.dll.  Then, create a new class file and inherit from CommunityServer.Components.ContentFragmentBase.  Allowing Visual Studio to complete the implementation of this abstract class automatically results in the following:

using System;
using System.Collections.Generic;
using System.Text;

namespace WidgetSamples
{
    public class MyWidget : CommunityServer.Components.ContentFragmentBase
    {
        public override void AddContentControls(System.Web.UI.Control control)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public override string FragmentDescription
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        public override string FragmentName
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }
    }
}

To complete the implementation of this widget, the three required members above must be implemented.

void AddContentControls(Control)

The AddContentControls method is used to populate the content of the widget.  All content must be added to the control.Controls collection.  To add literal text, the System.Web.UI.LiteralControl can be used, for example:

public override void AddContentControls(System.Web.UI.Control control)
{
    control.Controls.Add(new System.Web.UI.LiteralControl("This is my widget!"));
}

Because content fragments use Control objects, the content of widgets can take advantage of all of the existing ASP.Net and Chameleon controls.  Controls in widgets participate in the full page lifecycle and can initiate and handle call backs and post backs.

string FragmentDescription

The
FragmentName returns the name of this content fragment and is rendered in the widget selection control as well, above the description.  The name should be only a few words, such as:

public override string FragmentName
{
    get { return "My widget"; }
}

Once these three members are implemented, the class library can be compiled and it's output DLL can be deployed to Community Server's bin/ folder.

Implementing a Configurable Widget


Many widgets benefit from exposing end-user configurable options.  To support such options, the
alternate CommunityServer.Components.ConfigurableContentFragmentBase base-class can be used.  The ConfigurableContentFragmentBase class is similar to the ContentFragmentBase class used in the simple widget example above, but adds support for exposing and using Dynamic Configuration options.

To create a configurable content fragment, create a new class library project in Visual Studio and add a reference to CommunityServer.Components.dll, Telligent.DynamicConfiguration.dll, and System.Web.dll.  Then, create a new class file and inherit from
CommunityServer.Components.ConfigurableContentFragmentBase.  Allowing Visual Studio to complete the implementation of this abstract class automatically results in the following:

using System;
using System.Collections.Generic;
using System.Text;

namespace WidgetSamples
{
    public class MyConfigurableWidget : CommunityServer.Components.ConfigurableContentFragmentBase
    {
        public override void AddContentControls(System.Web.UI.Control control)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public override string FragmentDescription
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        public override string FragmentName
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        public override Telligent.DynamicConfiguration.Components.PropertyGroup[] GetPropertyGroups()
        {
            throw new Exception("The method or operation is not implemented.");
        }
    }
}

As you can see, the members are the same as with the simple widget with the exception of the new GetPropertyGroups method.

PropertyGroup[] GetPropertyGroups()

The GetPropertyGroups method is used to identify the Dynamic Configuration property groups, sub-groups, properties, selectable values, etc supported by the content fragment.  The layout of exposed properties is similar to themes' theme.config files, but instead of using an XML file, the layout is defined programmatically using classes in the Telligent.DynamicConfiguration.Components namespace.  For example, to define a simple text entry field (note that I added a "using Telligent.DynamicConfiguration.Components" statement to the top of the class file):

public override Telligent.DynamicConfiguration.Components.PropertyGroup[] GetPropertyGroups()
{
    PropertyGroup group = new PropertyGroup("group1", "Options", 0);
   
    Property textToRender = new Property("textToRender", "Text to Render", PropertyType.String, 0, "");
    group.Properties.Add(textToRender);

    return new PropertyGroup[] { group };
}

This defines a single configuration group (which renders as a tab) named "Options" containing a single string-based property named "Text to Render."  A full description of the Dynamic Configuration API is beyond the scope of this article, but the Intellisense for the Telligent.DynamicConfiguration.dll assembly as well as the existing examples of content fragments in the Community Server 2008 SDK should provide ample examples for defining configuration options.

The rendering of the configuration form and storage of the values entered by end-users is handled automatically by Community Server based on the definition of the
GetPropertyGroups method.

Using Configuration Options

To use the configuration options defined by the GetPropertyGroups method, the following methods (defined on the ConfigurableContentFragmentBase class) can be used based on the data type defined for the property:

- bool GetBoolValue(string id, bool defaultValue)
- int GetIntValue(string id, int defaultValue)
- double GetDoubleValue(string id, double defaultValue)
- string GetStringValue(string id, string defaultValue)
- string GetHtmlValue(string id, string defaultValue)
- DateTime GetDateValue(string id, DateTime defaultValue)
- DateTime GetTimeValue(string id, DateTime defaultValue)
- DateTime GetDateTimeValue(string id, DateTime defaultValue)
- Guid GetGuidValue(string id, Guid defaultValue)
- System.Drawing.Color GetColorValue(string id, System.Drawing.Color defaultValue)
- System.Web.UI.WebControls.Unit GetUnitValue(string id, System.Web.UI.WebControls.Unit defaultValue)
- Uri GetUrlValue(string id, Uri defaultValue)

In all of these examples, the first parameter is the ID of the property for which a value should be retrieved.  In our sample definition of the GetPropertyGroups method above, we defined a single string field with the ID "textToRender."  To render that field as the content of the content fragment, the GetStringValue method can be used, for example:

public override void AddContentControls(System.Web.UI.Control control)
{
    control.Controls.Add(new System.Web.UI.LiteralControl(this.GetStringValue("textToRender", "")));
}

This will render the user-defined value for the "Text to Render" field as the content of the control.

To finish the implementation of our configurable widget, the
FragmentDescription and FragmentName still need to be implemented as with the simple widget:

public override string FragmentDescription
{
    get { return "Renders custom text"; }
}

public override string FragmentName
{
    get { return "My Configurable Widget"; }
}

The class library can now be compiled and it's output DLL can be deployed to Community Server's bin/ folder. 

Additional Options

The base classes implement a few additional IContentFragment members that can be overridden by specific implementations to further customize widget rendering:

string GetFragmentHeader(Control)

By default, the FragmentName is rendered as the header of a rendered widget.  This behavior can be modified by overriding the base implementation of the GetFragmentHeader method.  This method returns the HTML to render as the content fragment's header. 

The control parameter to this method can be used to load contextual data, for example, via the
CommunityServer.Controls.CSControlUtility class

string GetFragmentMoreUrl(Control)

The out-of-the-box themes in Community Server 2008 support rendering a "more URL" for each widget -- for example, viewing all tags for the tag cloud widget or viewing the full list of active posts for the active posts widget.  By default, the "more URL" is blank and will not be rendered.

To set a "more URL", the GetFragmentMoreUrl method can be overridden to return the URL to navigate to view additional, related information.  Similar to the GetFragmentHeader method, the control parameter is supplied to support retrieving contextual information through Chameleon.

ApplicationType[] GetRelatedApplicationTypes()

As mentioned in the How to Support Widgets in a Custom Theme article, Community Server has built-in support for filtering available widgets by application types.  By default, the base classes identify no related application type which results in the content fragment being listed regardless of the application type filter. 

To identify the application type or types that relate to a content fragment, the GetRelatedApplicationTypes method can be overridden to return the array of related application types.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they're really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization - as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal's top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients' critical sites and services.

 



Community Server Hosting :: ExtendedAttributes in Community Server

clock May 25, 2010 08:17 by author Jervis

This topic contains brief information about Community Server. If you looking for Community Server hosting, you can always consider ASPHostPortal. At ASPHostPortal you can get a professional Community Server installation with your Community Server Hosting account. You can always start from our Portal ONE hosting plan (from @$5.00/month) to get this application installed on your website. So, why wait longer.

One thing people often need to do in Community Server, especially when customizing it, is to save custom data. Of course, if you’re feeling brave, you can always edit the database schema and related Data Providers as well as extending the relevant class (Weblog, Gallery, User etc.). Now this method is not without its merits, such as easier searching based on these new values, plus better performance where the values are to regularly accessed, and as ever, such factors should always be taken into account when extending Community Server.

What we want to talk about however, is the case where you want to simply store some extra information with an object. For example, one common request is to save extra contact information against a user. Currently, Community Server allows you to add IM addresses for MSN, AOL, Yahoo and ICQ contact details to a user’s profile, but you might want more! Another example might be that you wish a user to accept some specific terms/rules before you allow them to use your site (this came up on a recent client installation) so you need to record the date/time when they accepted.

By far the easiest way to achieve this is by using ExtendedAttributes. Most of the major classes in CS inherit from ExtendedAttributes such as User, Post & Section (in turn Weblog, Gallery, Forum etc inherit from Section as WeblogPost, GalleryPost etc. inherit from Post). All of these classes have two methods that you can use to set and retrieve this data and these are GetExtendedAttribute() & SetExtendedAttribute(). Under the hood, the ExtendedAttributes class uses a NameValueCollection object to store the data so naturally, SetExtendedAttribute()requires just two parameters; name and value.

So, to assign a users GoogleTalk address:

User user = CSContext.Current.User; // Get the logged on user.

user.SetExtendedAttribute("GoogleTalkAccount", "usersaccount"); // Set the new details.

Users.UpdateUser(user); // Save the changes.

And to retrieve that data:

string googleTalkAccount = user.GetExtendedAttribute("GoogleTalkAccount");

Or, to set the date that a user accepted the terms to your site;

User user = CSContext.Current.User; // Get the logged on user.

user.SetExtendedAttribute("TermsAccepted", DateTime.Now.ToString()); // Set the date.

Users.UpdateUser(user); // Save the changes.

And again, to retrieve this:

DateTime termsAccepted = Convert.ToDateTime(user.GetExtendedAttribute("TermsAccepted"));

Of course, normally, you’d need to check the above string before trying to cast it as a DateTime, but we’ll skip that for the purposes of this article. As a side note, if the ExtendedAttribute doesn’t exisit in the colletion, GetExtendedAttribute() will return an empty string.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they're really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization - as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal's top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients' critical sites and services.

 



Community Server Hosting :: Fix for Posting Comments from Feed Readers

clock May 21, 2010 06:41 by author Jervis

Out of the box, CS has virtually no implementation for CommentRSS (which is strange as .Text supports it 100%…curious as to why Telligent didn’t include it with CS).  We followed the same pattern that .Text uses by implementing a custom httpHandler to intercept requests for a specific Url that comments are sent to from feed readers.  The first thing you’ll need to do is add a new class in the CommunityServerBlogs project (in the Components/Syndication folder); name it RssCommentHandler.cs, and make sure to change the namespace to CommunityServer.Blogs.Components (as C# projects will include the full directory structure in the namespace by default…interestingly enough VB.Net doesn’t do this, defaults to the root namespace).  Here’s the code you’ll need to add to the new class:

using System;

 using System.Web;

 using System.Web.Caching;

 using System.IO;

 using System.Xml;

 
 // CS

 using CommunityServer.Components;

 using CommunityServer.Blogs.Components;

  
 
namespace CommunityServer.Blogs.Components

 {

     /// <summary>

     /// Summary description for CommentHandler.

     /// </summary>

     ///

     // jervis -- fix for posting comments from feed readers

     public class RssCommentHandler : IHttpHandler

     {

         private RssCommentHandler() { }
 

         #region IHttpHandler Members
 

         public void ProcessRequest(HttpContext context)

         {

             HttpRequest request = context.Request;

             if(request.RequestType == "POST" && request.ContentType == "text/xml")

             {

                 XmlDocument doc = new XmlDocument();

                 doc.Load(request.InputStream);
 

                 User user = Users.GetUser();

                 int postID = getPostIDFromUrl(request.RawUrl);
 

                 WeblogPost commentedEntry = WeblogPosts.GetPost(postID, false, true, false);

                 Weblog blog = commentedEntry.Section as Weblog;
 

                 // if comments aren't enabled, throw an http forbidden exception

                 if (!blog.EnableComments)

                 {

                     throw new HttpException(403, "Comments are not enabled");

                 }
 

                 Permissions.AccessCheck(blog, Permission.View, user);
 

                 string name = doc.SelectSingleNode("//item/author").InnerText;

                 if(name.IndexOf("<") != -1)

                 {

                     name = name.Substring(0,name.IndexOf("<"));

                 }
 

                 WeblogPost post = new WeblogPost();

                 post.SubmittedUserName = name.Trim();

                 post.BlogPostType = BlogPostType.Comment;

                 post.SectionID = blog.SectionID;

                 post.ParentID = postID;

                 post.Body = doc.SelectSingleNode("//item/description").InnerText;

                 post.Subject = doc.SelectSingleNode("//item/title").InnerText;

                 post.TitleUrl = checkForUrl(doc.SelectSingleNode("//item/link").InnerText);

                 post.IsApproved = true;

                 post.PostDate = DateTime.Now;

                 post.BloggerTime = DateTime.Now;

                 WeblogPosts.Add(post, user);

             }

             else

             {
 
                      

             }

         }
 

         private string checkForUrl(string text)

         {

             if(text == null || text.Trim().Length == 0 || text.Trim().ToLower().StartsWith("http://"))

             {

                 return text;

             }

             return "http://" + text;

         }
 

         private int getPostIDFromUrl(string uri)

         {

             try

             {

                 return Int32.Parse(getReqeustedFileName(uri));

             }

             catch (FormatException)

             {

                 throw new ArgumentException("Invalid Post ID.");

             }

         }
 

         private string getReqeustedFileName(string uri)

         {

             return Path.GetFileNameWithoutExtension(uri);

         }
 

         public bool IsReusable

         {

             get

             {

                 return true;

             }

         }
 

         #endregion

     }

 }

The next change is in CommunityServer.Blogs.Components.WeblogRssWriter.PostComments method.  Add the following code:

// Jervis -- fix for posting comments from feed readers

// only write the wfw:comment tag if comments are enabled for this weblog

if (CurrentWeblog.EnableComments)

{

    this.WriteElementString("wfw:comment", FormatUrl(BlogUrls.Instance().RssComments(CurrentWeblog.ApplicationKey,p.PostID)));

}

As we’re looking for a new RssComments Url, we need to modify the CommunityServer.Blogs.Components.BlogUrls class with a new method to find the rewritten Url; add this method to this class:

// jervis -- fix for posting comments from feed readers

public virtual string RssComments(string applicationKey, int PostID)

{

    return FormatUrl("weblogRssComments", applicationKey, PostID);

}

We then need to tell CS how to rewrite this Url so that it formats correctly; thankfully the infrastructure for this is already in place via the SiteUrls.config file; add the following element in the HomePages section:

<!-- jervis fix for posting comments from feed readers -->

<url name = "weblogRssComments" location = "weblogs" path="rsscomments/{1}.aspx" pattern="rsscomment

And finally, we need to map an httpHandler to our newly created RssCommentHandler class to intercept requests for rsscomments/*.aspx; add the following element to the httpHandlers section of the root web.config file:

<!-- jervis fix for posting comments from feed readers -->

<add verb="POST" path = "rsscomments/*.aspx" type="CommunityServer.Blogs.Components.RssCommentHandler,

Done.

We will say this about CS; it’s Url rewriting infrastructure is powerful stuff; adding a new Url is a snap with it…this would have taken much longer without this in place.  Oh, and my new website is now officially done.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they're really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization - as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal's top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients' critical sites and services.

 



Community Server Hosting :: Creating, Editing, Deleting Articles

clock May 19, 2010 05:39 by author Jervis

This topic contains brief information about Community Server. If you looking for Community Server hosting, you can always consider ASPHostPortal. At ASPHostPortal you can get a professional Community Server installation with your Community Server Hosting account. You can always start from our Portal ONE hosting plan (from @$5.00/month) to get this application installed on your website. So, why wait longer?

Creating Articles

To create an article you must be a System Administrator. Open up Control Panel. In the System Administration box, select Site Administration. Under the Site Content tab, select Manage / Create Articles. To create a new article, press the Create new article button.

When the Create Article page opens you have three fields to fill in.
- Name – This is the name you’ll see when viewing articles in the Control Panel, and will also be used as the url for the article. The article url will be /content/ARTICLENAME.aspx. Because of this any spaces in the article name will be removed.
- Headline – The Headline is the title users appear
- Body – the main body of your article goes in the HTML Editor

Editing the Articles

There are two ways you can edit an article, but both require you to be a system administrator.
1. Open the article in your browser, and then press the Edit button in the breadcrumb area (just under the Navigation).

2. Open up Control Panel. In the System Administration box, select Site Administration. Under the Site Content tab, select Manage / Create Articles. Find the article in the list you want to edit.

Deleting Articles

To delete an article, follow the steps above to edit an article, but instead of editing the article and saving it, press the ‘clear’ button.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they're really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization - as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal's top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients' critical sites and services.

 



ASPHostPortal Community Server Hosting :: Adding Pages to Community Server 2007

clock May 15, 2010 09:21 by author Jervis

Step 1
Start off by creating a new directory called "Sample" in your root web directory. (referred to web/sample/ from here on out).

Now create a new text file called "Default.aspx", open up this file with notepad, and add the following lines.

<%@ Page %>
<%--
This is my placeholder, my actual file is located in web/themes/[THEME NAME]/sample/sample.aspx
--%>


Step 2 - Creating the themed page
For this article, we will only be covering how to do this on the default theme, you can pretty much apply this to all other themes.

In your web/Themes/ directory, create a new directory called "sample".

Next, create a new text file and name it "sample.master", open up this file with notepad, and add the following lines.

<%@ Master Language="C#" AutoEventWireup="true" MasterPageFile="../Common/master.Master" %>

<asp:Content ContentPlaceHolderID="HeaderRegion" runat="server" >
    <CSControl:SelectedNavigation Selected="sample" runat="Server" />
    <CSControl:ThemeStyle runat="server" href="~/style/forum.css" mce_href="~/style/forum.css" />
    <CSControl:ThemeStyle runat="server" href="~/style/gallery.css" mce_href="~/style/gallery.css" />
    <CSControl:ThemeStyle runat="server" href="~/style/forum_print.css" mce_href="~/style/forum_print.css" media="print" />
    <CSControl:ThemeStyle runat="server" href="~/style/gallery_print.css" mce_href="~/style/gallery_print.css" media="print" />
</asp:Content>

<asp:Content ContentPlaceHolderID="bcr" runat="server">
    <asp:ContentPlaceHolder id="bcr" runat="server" />
</asp:Content>

<asp:Content ContentPlaceHolderID="rcr" runat="server" >
    <asp:ContentPlaceHolder ID="rcr" runat="server" />
</asp:Content>

Just to explain a bit, we have created a new master page that inherits the master.Master for the website, we have overridden the header region to select the "sample" page, and finally we have created two content regions for the page (CS 2007 style).

At this point, you can add any custom code to the your new pages "main" template, but for now, lets just leave it as is.

Now, lets create another text file, and call it "sample.aspx" and open it up in notepad.

The first thing we want to do in this file, is all of the standard asp.net page definitions, as well as import some common namespaces, useful for coding later on.  This also keeps our "ad support".

<%@ Page EnableViewState="false" Language="C#" AutoEventWireup="true" Inherits="CommunityServer.Controls.CSThemePage" MasterPageFile="sample.Master" %>
<%@ Import Namespace="CommunityServer.Components" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register TagPrefix="CSUserControl" TagName="AdTop" src="../Common/Ad-Top.ascx" mce_src="../Common/Ad-Top.ascx" %>
<%@ Register TagPrefix="CSUserControl" TagName="AdBottom" src="../Common/Ad-Bottom.ascx" mce_src="../Common/Ad-Bottom.ascx" %>

Next, we will set the pages title, this is something that we can't remember seeing in CS 2.1, its quite useful for creating "sub" sites within your main site.  For now we will set the title to the default site name.

<script language="C#" runat="server">

    void Page_Load()
    {
        SetTitle(CurrentCSContext.SiteSettings.SiteName, false);
    }

</script>

Now we will move on to adding our bcr area or, Body Content Area.  This is much cleaner then the previous way of adding content parts, as you now don't have to be a html code guru and can simply enter in regular html code.

<asp:Content ID="Content1" ContentPlaceHolderID="bcr" runat="server">
    <div class="CommonContentArea">
 <CSControl:AdPart runat = "Server" contentname="StandardTop" ContentCssClass="CommonContentPartBorderOff" ContentHoverCssClass="CommonContentPartBorderOn">
     <DefaultContentTemplate>
         <CSUserControl:AdTop runat="server" />
     </DefaultContentTemplate>
 </CSControl:AdPart>

 <div class="CommonContent">
            <CSControl:ContentPart ContentName="sample" runat="server" ContentCssClass="CommonContentPartBorderOff" ContentHoverCssClass="CommonContentPartBorderOn">
                <DefaultContentTemplate>
                    <h2 class="CommonTitle">Sample Page</h2>
                    <div class="CommonContent">
                        <div style="line-height: 140%;">
           You have created a sample page!
                        </div>
                    </div>
                </DefaultContentTemplate>
            </CSControl:ContentPart>
       
 </div>
 
 <CSControl:AdPart runat="Server" ContentName="StandardBottom" ContentCssClass="CommonContentPartBorderOff" ContentHoverCssClass="CommonContentPartBorderOn">
     <DefaultContentTemplate>
         <CSUserControl:AdBottom runat="server" />
     </DefaultContentTemplate>
 </CSControl:AdPart>
    </div>
</asp:Content>

Finally, lets add our rcr area or, Right Content Area.

<asp:Content ContentPlaceHolderID="rcr" runat="server">
    <div class="CommonSidebar">
 <CSControl:ContentPart ContentName="sampleSidebar1" runat="server" ContentCssClass="CommonContentPartBorderOff" ContentHoverCssClass="CommonContentPartBorderOn">
            <DefaultContentTemplate>
                <div class="CommonSidebarArea">
                 <div class="CommonSidebarRoundTop"><div class="r1"></div><div class="r2"></div><div class="r3"></div><div class="r4"></div></div>
                 <div class="CommonSidebarInnerArea">
                  <h4 class="CommonSidebarHeader">Sidebar 1</h4>
                  <div class="CommonSidebarContent">
                            <p>
                                Sign-in with your Admin account and double-click to edit me!
                            </p>
                        </div>
                 </div>
                 <div class="CommonSidebarRoundBottom"><div class="r1"></div><div class="r2"></div><div class="r3"></div><div class="r4"></div></div>
                </div>
            </DefaultContentTemplate>
        </CSControl:ContentPart>
    </div>
</asp:Content>

Adding the page to the SiteUrls
Unlike CS 2.1, you must complete this next step for a page to even load in the web application.

Open up the "SiteUrls.config" file with notepad.

Scroll down to around line 562. You will see a comment that says "When adding custom locations, add above here."  We are going to do just that.

Add the following just above the comment.

  <location name="sample" path="/sample/" themeDir="sample">
    <url name="samplehome" path="" pattern="default.aspx" vanity="{2}" physicalPath="##themeDir##" page="sample.aspx" />
  </location>

Now, before you go jumping off to your newly created page, we have a few more things to do, or else you are going to get some errors.

Adding the link to the top menu
With the SiteUrls.config file still open, scroll down the bottom to the "navigation" section.  Just under the "home" link, add the following.

<link name="sample" resourceUrl="samplehome" resourceName="sample" roles="Everyone" />

Save the file, and go ahead and close the SiteUrls.config.

As you noticed in my previous articles, until you add the resource to the resources.xml, your link will not show up on the main link menu.

Navigate to "web/languages/[YOUR LANGUAGE]/" and open up the file "Resources.xml" with notepad.

Around line 44, you will see the text "<!-- Main Navigation -->"  just below the "Home" resource, add the following code.

<resource name="sample">Sample</resource>

Save the file.

Restarting the web application
At this point we need to just "touch" the web.config file, this is done by opening the file with notepad, saving, then closing the file.

Navigate to your newly created page
Finally, you should be able to goto your home page, click on the sample link, and see your new page!

If you don't see it, start back at the beginning and find out what you did wrong.  Or post up in my forums for help and We will try to help you out.

Contact us at http://www.asphostportal.com.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they're really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization - as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal's top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients' critical sites and services.

 



About ASPHostPortal.com

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions


Author Link


Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Sign in