ASPHostCentral BLOG

All about ASP.NET 4 Hosting, Windows and ASP.NET Technology

Sharepoint Hosting :: Tricks and Traps with Site Columns and Content Types

clock March 3, 2010 19:03 by author Administrator
One of the main selling points of SharePoint is the ability to push content management down to the End User instead of having a dedicated IT staff or Information Management Team manages sites and content. From my perspective, this is also one of its biggest downfalls.

The single greatest problem of a beginning End User is not having an understanding of how to structure a library or list
so that it can be part of a centrally managed site structure, built for reusability with document templates attached. Forget about site design. Forget about user interface. They are told to start by adding columns to a library/list to make the information searchable and manageable through metadata, when most End Users do not have a clear understanding of what that is (metadata) much less how to  structure it.

Allowing contributors of content the power to control the Information Architecture of a site
or list/library assumes they have the understanding and knowledge of how to structure information so that it is robust, reusable, modular and accessible to all users of that content. This places too much burden on the End User, who is usually an untrained content contributor who just wants to contribute and consume information.

Understanding Content Types is essential when managing a quickly growing site
through an expandable, controllable infrastructure. More than in other installments of SharePoint 101: Tricks and Traps, you must be able to put Site Columns and Content Types into your own context to get an understanding of how powerful they are. With each problem statement in this installment, try to rephrase the problem so that it relates directly to a situation in your SharePoint environment.

This section of Tricks and Traps starts with an overview of Site Columns and how they relate to Content Types
.  From the overview, we will move into common scenarios using Site Columns to create Content Types. We will end with a series of links to Microsoft’s Knowledge Base, focusing on their in-depth descriptions and examples of Content Types.

The following article summarizes one of the features in Sharepoint Services called Site Columns. ASPHostCentral.com, as the premier ASP.NET and Windows Hosting provider, proudly presents this article to anyone and we believe it will help many ASP.NET communities; especially to those who are using Sharepoint Service. In case you are looking for Sharepoint Hosting, you can always consider ASPHostCentral.com and you can start from our lowest Standard Plan @$4.99/month to host your Sharepoint site.


Introduction to Site Columns

Newly created libraries and lists consist of default columns. These columns are the document or list properties/attributes that are set by default when a list or library is created. You can think of metadata as the aggregate list of these properties. 

Default Document Columns

There are 17 default properties (attributes) associated with an item in a document library. To see the default properties, choose View: Modify this view from the View menu in any newly created document library. You will see the following list:
  1. Type (icon linked to document)
  2. Name (linked to document with edit menu)
  3. Modified (date)
  4. Modified By (person)
  5. Checked Out To (person)
  6. Check In Comment (text)
  7. Content Type
  8. Copy Source (link)
  9. Created (date)
  10. Created By (person)
  11. Edit (link to edit item)
  12. File Size (kb)
  13. ID (unique identifier)
  14. Name (for use in forms)
  15. Name (linked to document)
  16. Title (text)
  17. Version (number)
These properties are the default metadata for any document uploaded, created or published to the library. Stop for a second and think about that… every document knows these 17 things about itself. This is the foundation of the metadata structure for any document within SharePoint.

Core Document Columns

There are additional attributes/properties that can be carried by documents within a SharePoint library. These properties are not available by default, but can be added to the metadata structure of the library and are called “Core Document Columns”. They are listed in the Site Column Gallery for site and site collection administrators. The twenty Core Document Columns are a small subset of all the site columns available in a default SharePoint installation.The Core Document Columns can be found under Site Actions -> Site Settings, Galleries: Site columns:
  1. Author
  2. Category
  3. Comments
  4. Contributor
  5. Coverage
  6. Date
  7. Date Modified
  8. Date Picture Taken
  9. Format
  10. Keywords
  11. Last Printed
  12. Publisher
  13. Relation
  14. Resource Identifier
  15. Resource Type
  16. Revision
  17. Rights Management
  18. Source
  19. Subject
  20. Version
Custom Site ColumnsSharePoint offers the ability to create customized site columns when the default document library columns and the Core Document Columns are not what is needed to identify a document.As an example, if you create a Technical Publications “Specifications Library” there might be a need to associate a specific product with every document. There is no such thing as a default “Product” column in SharePoint. By creating the Product site column and making it mandatory (required) in the Specifications library, when a document is inserted into the library, the document will know what project it is related to.


Introduction to Content Types

Individual site columns can be made much more useful when they are grouped together to create an entire metadata structure. This grouping of site columns is called a Content Type.

Overview of Content Types

A Content Type is a reusable grouping of site columns that can be utilized by a list or library. This makes it possible to maintain a consistent metadata structure for all documents or items of that type in a Site Collection.

A Content Type can carry a workflow,  an Information Management Policy and a document template along with the site columns. Whenever the Content Type is associated with a library or list, all of the functionality built into the customization of that Content Type will be available to that library or list.

Using an example from the EndUserSharePoint.com Site Collection Administration Workshop, let’s take a look at a customized Content Type.The Site Collection Administrator needs a method for accepting new site creation requests, new library requests and requests for help with site planning. All three of these requests have five things in common:
  1. Requester Name
  2. Requester Email
  3. Time Frame
  4. Priority of this Request
  5. Comments
A Content Type can be created to manage all of these columns as a single group of metadata that can be applied to any list that needs it. In our case, all request lists need to have this customized Request Content Type associated with it.

Using a single Content Type in multiple lists allows for consistency in the data structure. The consistency adds to the ability to find those list items through a search across the metadata. “Find me all list items that have a Priority of ‘High’ that were requested by ‘Mark Miller or Bob Mixon’”.

An added benefit of using a Content Type in multiple locations is maintainability. Any changes to the parent Content Type can be passed down to any list that is using that Content Type.One of the things missing from the Request Content Type described above is the ‘Status’ of the request (Open, In progress, Completed, Denied). Adding a Status column to the Request Content Type will now create that column in any list that is utilizing our customized Content Type.


Summary

Site columns and Content Types are the foundation of Information Architecture planning in SharePoint
. Too much duplication of effort is typically done because of lack of planning before starting to build the infrastructure of a Site Collection.Utilizing site columns and Content Types takes additional effort in the upfront time spent when setting up a SharePoint Site Collection, but the investment of time at the beginning will pay huge dividends during the management and maintenance phase of your SharePoint implementation. 


WCF RIA Service Hosting :: WCF RIA Service Configuration in a Shared Hosting/Server

clock March 2, 2010 15:00 by author Administrator
The following article summarizes all the possible problems that may arise when deploying a WCF RIA Service application to a shared host. ASPHostCentral.com, as the premier ASP.NET and Windows Hosting provider, proudly presents this article to anyone and we believe it will help many ASP.NET communities; especially to those who are using WCF RIA Service. In case you are looking for WCF RIA Service Hosting, you can always consider ASPHostCentral.com and you can start from our lowest Standard Plan @$4.99/month to host your WCF-service site.

Why : RIA framework dynamically creates WCF service (Domain services) and add endpoints to the service. It first checks if endpoint does not exist then create it, and it checks for 3 endpoints (http, SOAP and binary). After creating end points it adds authentication schema to end points. It picks IIS authentication schemas and tries to apply on end points and failed to apply.

If we could create desired end points in web.config RIA framework will not create or do anything with endpoints and it works successfully.

You just need to follow the simple steps as mentioned on the followings:

1. Add following code to you web.config to solve issue “This collection already contains an address with scheme http..

<serviceHostingEnvironment aspNetCompatibilityEnabled="true">

<baseAddressPrefixFilters>
<add prefix="http://www.yoursite.com"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>


Note: Your service can be only accessed by URL mentioned in above settings. As configured above you can’t access your service via http://yoursite.com. You could also use factory code to host WCF (see below) to resolve this error however alone with that you need to create svc files for each domain service.

2.Add AspNetCompatibilityRequirementsMode attribute to your RIA Domain services classes
Eg .Attributes added to AuthenticationService class under services folder

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

public class AuthenticationService : AuthenticationBase<User> { }


RIA framework dynamically apply these attributes after creating end points. Since we are now bypassing endpoint creation, we need to manually apply these attributes.

3. For each RIA domain service add following to you configuration file.
E.g. Is shown for AuthenticationService and UserRegistrationService
Where SparkExams is my custom namespace.
<services>

<service name="SparkExams.Web.AuthenticationService"
behaviorConfiguration="RIAServiceBehavior">
<endpoint address="" binding="wsHttpBinding"
contract="SparkExams.Web.AuthenticationService" />
<endpoint address="/soap"
binding="basicHttpBinding"
contract="SparkExams.Web.AuthenticationService" />
<endpoint address="/binary"
binding="customBinding"
bindingConfiguration="BinaryHttpBinding"
contract="SparkExams.Web.AuthenticationService" />
</service>

<service name="SparkExams.Web.UserRegistrationService"
behaviorConfiguration="RIAServiceBehavior">
<endpoint address=""
binding="wsHttpBinding"
contract="SparkExams.Web.UserRegistrationService" />
<endpoint address="/soap"
binding="basicHttpBinding"
contract="SparkExams.Web.UserRegistrationService" />
<endpoint address="/binary"
binding="customBinding" bindingConfiguration="BinaryHttpBinding"
contract="SparkExams.Web.UserRegistrationService" />
</service>


Please note that RIA adds 3 endpoints and if any of these endpoints are missing from web.config it will throw "IIS specified authentication schemes 'Basic, Anonymous'..." error.

Add following behaviours and bindings to your web.config
<behaviors>

<serviceBehaviors>
<behavior name="RIAServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="BinaryHttpBinding">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>


Test you WCF end points using WCF client test tool (Test client for Windows Communication Foundation services). WcfTestClient.exe : Go to VS 2008 Console and type WcfTestClient.exe.

Note that there is no need to host you service,or change IIS settings by ISP.

-----------------------------------------------------------------------------

Read further if you want to know how this configuration has been discovered...

1. Have Used Red Gate's .NET Reflector to examine RIA assemblies.
2. Plugin my custom DomainServiceHost factory to host service.
3. Set debug points on overridable methods "ApplyConfigutation()" in CustomHost
Please find code for class used to injected service host factory at the end of this post.
4. Check where the code was failing and what RIA has configured before failing.Found that it have configured 3 endpoints for each service. Noticed the minimal configuration and rectified other errors one by one.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Ria.Services;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Description;
using System.ServiceModel.Channels;
using System.ComponentModel;
using System.Web.DomainServices;
using System.Net;
namespace System.Web.Ria {
public class DomainServiceHostFactoryEx : DomainServiceHostFactory
{
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
Uri baseAddress=null;

try
{
baseAddress = baseAddresses[0];
}
catch (Exception e)
{
baseAddress = new Uri("http://localhost:52878");
}

CustomHost customServiceHost =
new CustomHost(serviceType, baseAddress);
return customServiceHost;
}
}

class CustomHost : DomainServiceHost
{
DomainServiceDescription _domainServiceDescription;
ServiceDescription _sdecreption;
ContractDescription _contract;
public CustomHost(Type serviceType, params Uri[] baseAddresses)
: base(serviceType, baseAddresses)
{
this._domainServiceDescription = DomainServiceDescription.GetDescription(serviceType);

}

protected override ServiceDescription CreateDescription(out IDictionary<string, ContractDescription> implementedContracts)
{
ServiceDescription d = base.CreateDescription(out implementedContracts);
//_contract = implementedContracts[0];
_sdecreption = d;
return d;
}
protected override void ApplyConfiguration()
{
//base.LoadConfigurationSection(new System.ServiceModel.Configuration.ServiceElement(_sdecreption.ConfigurationName));
// try
//{
string error = "";
try
{
base.ApplyConfiguration();
}
catch (Exception applyconfigerror) { error += "Error1:" + applyconfigerror.Message + "\r\n"; }

try
{
//this.AddEndpoints();
}
catch (Exception applyconfigerror) { error += "Error2:" + applyconfigerror.Message + "\r\n"; }

try
{
// this.AddDefaultBehaviors();
}
catch (Exception applyconfigerror) { error += "Error3:" + applyconfigerror.Message + "\r\n"; }


//if (error.Length > 0) HttpContext.Current.AddError(new Exception( error));

//this.AddEndpoints();
//this.AddDefaultBehaviors();

using (IEnumerator<ServiceEndpoint> enumerator = base.Description.Endpoints.GetEnumerator())
{
while (enumerator.MoveNext())
{
ServiceEndpoint current = enumerator.Current;
//current.Binding.Scheme
}
}

//}
//catch (Exception ex)
// {
//HttpContext.Current.AddError(ex);
// }

}
}
}


ASP.NET 4 Hosting :: Working with a Database using Model-First Development Technique

clock March 1, 2010 20:14 by author Administrator
Introduction


The upcoming release of Visual Studio 2010 will contain the Entity Framework 4 which is Microsoft's second release of the Entity Framework.  The new and improved EF4 contains a boat load of new features which many developers have suggested after using version 1.  It also comes closer to the features offered in other Object-Relational Mapping tools such as NHibernate.  Object-Relational Mapping tools are used to eliminate much of the tedious code needed to have an application persist and retrieve data from a database.  The developer uses a visual interface to build classes that map to tables, relationships, stored procedures, and other objects in a database.  One of the great new features of EF4 is the ability to create an ADO.NET Entity Data Model and then build the database from the model.  Previously the developer needed to create the database first and then generate the model.  EF4 still supports reverse engineering a database but being able to use Visual Studio to design a database based off of an object model is a big step forward with this tool.

Today, we are going to discuss a way to create a database using Model-First Development Technique. ASPHostCentral.com, as the premier ASP.NET and Windows Hosting provider, proudly presents this article to anyone and we believe it will help many ASP.NET communities; especially to those who are using ASP.NET 4 Framework. In case you are looking for ASP.NET 4 Hosting, you can always consider ASPHostCentral.com and you can start from our lowest Standard Plan @$4.99/month to host your WCF-service site.

The goal of this article is to show you how to create an ADO.NET Entity Data Model using the Entity Framework 4.  This article uses Visual Studio 2010 Beta 2 so some of the steps may change once the final version is released to production.  Future articles will build upon this application to dive deeper into the EF4 to demonstrate how to query and display data, incorporate stored procedures, customize the classes generated by the EF4, and much more.

Creating a Database using Model-First Development


Step 1: Create a New Solution

1. Launch Visual Studio 2010 Beta 2
2. Click the New Project link on the Start Page.  The New Project dialog box should appear
3. Click on the Visual C# node from the tree view of installed templates
4. Select Empty ASP.NET Web Application from the list of templates
5. Enter OrderSystem for the project name and click the OK button

Visual Studio will create a solution file in the folder you specified and also create a sub folder that contains the web site's project file and config files


Step 2: Create an ADO.NET Entity Data Model

The next step is to create the ADO.NET Entity Data Model.  For this application we'll model the concept of users and addresses.  A user can have more than one address so we'll build an entity data model that models this relationship

1. Right click on the OrderSystem project in the Solution Explorer and select Add à New Item…
2. Click the Data node under the Visual C# node in the Installed Templates tree
3. Select the ADO.NET Entity Data Model template
4. Change the name to OrderDB.edmx and click the Add button
5. Visual Studio will display the Entity Data Model Wizard.  This is where you can decide to build the model from an existing database or create the model first and then build the database
6. Choose Empty model from the wizard and click the Finish button

The OrdersDB.edmx file will be added to your project and the file will be displayed in the Entity Framework Designer


Step 3: Create the Entities and Associations


The next step is to model the user and user's addresses relationship. Let's first create the user entity.

1. Right click on the Entity Data Model Designer and select AddàEntity… from the pop-up menu
2. The Add Entity dialog box should appear.  Enter UserAccount for the Entity name.  Notice that as you type the Entity name the Entity Set name pluralizes the Entity name.  Think of the Entity name as the class that represents a record and the Entity set as the class that represents the table of those records
3. By default the Entity Framework will create a Primary Key called Id.  If you wish to not create a primary key you can uncheck the Create key property checkbox from the dialog box.  For this example we want a primary key so leave the box checked
4. Click the OK button. The UserAccount entity will be added to the entity diagram
5. The next step is to add properties to this entity. Properties will map to fields in a table. We'll first add the First and Last name properties
6. Right click on the UserAccount entity and select AddàScalar property from the pop-up menu
7. Change the property name to FirstName
8. In the properties window change the MaxLength to 50. Scalar properties are strings by default
9. Add another property called LastName the same way and set its MaxLength to 50

The next step is to add and insert date and update date properties.  I like to have the inserted and updated dates on every entity just for the sake of trouble shooting.  These are two properties that will be added to every entity so it is the perfect candidate for a Complex Type.  A Complex Type allows you to define a set of properties and then associate them with multiple entities.

10. In the Model Browser window, left click on the Complex Types nodes.  Sometimes you have to click more than once for the node to be selected.  I'm using Beta 2 so hopefully this will be fixed when it goes live.  Once the node is selected right click and select Create Complex Type from the pop-up menu



11. Change the name of the complex type to AuditFields
12. Right click on the AuditFields complex type in the Model Browser and select AddàScalar PropertyàDateTime from the pop-up menu
13. Change the name to InsertDate
14. Follow the same steps to add the UpdateDate property to the complex type
15. Now you can add the Complex property to the UserAccount entity.  Right click the UserAccount entity and select AddàComplex Property from the pop-up menu
16. Change the name to AuditFields.  The type should have already defaulted to AuditFields

When the database is created from this entity it will contain the two audit fields defined in the complex type.Now let's add the address entity.  A user can have more than one address so there is a one-to-many relationship between these two entities

17. Right click the designer and select AddàEntity from the pop-up menu
18. Change the name to Address and then click the OK button
19. Add scalar properties to the Address entity for Address1, Address2, City, State, and Zip.  All of these properties should be strings with lengths of 50, 50, 50, 2, and 5 respectively
20. Change Address2 to be nullable by settting the Nullable property to True in the properties window.  All other properties are required
21. Now add the Audit Fields to this entity by right clicking the Address entity and selecting AddàComplex Property from the pop-up menu.  Set the name to AuditFields and the type to AuditFields

The next step is to create an association between the UserAccount and Address entities.

22. Right click on the UserAccount entity and select AddàAssociation from the pop-up menu
23. The Add Association dialog appears.  It assumes correctly that you want to create a one-to-many relationship between these two entities.  You use the Multiplicity drop down to define the variations of relationships but for this example you can leave the defaults and click the OK button.  Notice that a UserAccountId property was added to the Address table

Step 4: Generate the Database

Now that the entities are defined we can create the database.  Visual Studio makes this quite simple.  A script is generated with the correct DDL statements to create tables, indexes, and relationships which you can then execute against your database

1. Right click on the Designer and select Generate Database from Model… from the pop-up menu.  The Generate Database Wizard will appear
2. Click the New Connection… button
3. Enter your Server Name. Choose either User Windows Authentication or Use SQL Server Authentication.  Whichever you choose you need a user that has permissions to create a database on the server.  For this example I'll use Windows Authentication
4. Enter OrderSystem for the name of the database and click the OK button
5. You should get a message stating "The database 'OrderSystem' does not exist or you do not have permissions to see it.  Would you like to attempt to create it?"  Click the Yes button
6. The database should be created and you'll be returned to the Generate Database Wizard dialog.  Click the Next button
7. The wizard will now generate the DDL statements needed to create this database
8. Click the Finish button
9. A new file will be added to the project called OrderDB.edmx.sql. The file contains the DDL statements to create the database.  The text of the file is as follows:
-- --------------------------------------------------
-- Date Created: 01/17/2010 09:39:04-- Generated from EDMX file: C:\Documents and Settings\VinceVarallo\-- my documents\visual studio 2010\Projects\OrderSystem\OrderSystem\OrderDB.edmx-- -------------------------------------------------- SET QUOTED_IDENTIFIER OFF;SET ANSI_NULLS ON;GO USE [OrderSystem]GOIF SCHEMA_ID(N'dbo'IS NULL EXECUTE(N'CREATE SCHEMA [dbo]')GO -- ---------------------------------------------------- Dropping existing FK constraints-- --------------------------------------------------  -- ---------------------------------------------------- Dropping existing tables-- --------------------------------------------------  -- ---------------------------------------------------- Creating all tables-- -------------------------------------------------- -- Creating table 'UserAccounts'CREATE TABLE [dbo].[UserAccounts] (    [Id] int  NOT NULL,    [FirstName] nvarchar(50)  NOT NULL,    [LastName] nvarchar(50)  NOT NULL,    [AuditFields_InsertDate] datetime  NOT NULL,    [AuditFields_UpdateDate] datetime  NOT NULL);GO-- Creating table 'Addresses'CREATE TABLE [dbo].[Addresses] (    [Id] int  NOT NULL,    [Address1] nvarchar(50)  NOT NULL,    [Address2] nvarchar(50)  NULL,    [City] nvarchar(50)  NOT NULL,    [State] nvarchar(2)  NOT NULL,    [Zip] nvarchar(5)  NOT NULL,    [AuditFields_InsertDate] datetime  NOT NULL,    [AuditFields_UpdateDate] datetime  NOT NULL,    [UserAccountId] int  NOT NULL);GO -- ---------------------------------------------------- Creating all Primary Key Constraints-- -------------------------------------------------- -- Creating primary key on [Id] in table 'UserAccounts'ALTER TABLE [dbo].[UserAccounts] WITH NOCHECK ADD CONSTRAINT [PK_UserAccounts]    PRIMARY KEY CLUSTERED ([Id] ASC)    ON [PRIMARY]GO-- Creating primary key on [Id] in table 'Addresses'ALTER TABLE [dbo].[Addresses] WITH NOCHECK ADD CONSTRAINT [PK_Addresses]    PRIMARY KEY CLUSTERED ([Id] ASC)    ON [PRIMARY]GO -- ---------------------------------------------------- Creating all Foreign Key Constraints-- -------------------------------------------------- -- Creating foreign key on [UserAccountId] in table 'Addresses'ALTER TABLE [dbo].[Addresses] WITH NOCHECK ADD CONSTRAINT [FK_UserAccountAddress]    FOREIGN KEY ([UserAccountId])    REFERENCES [dbo].[UserAccounts]        ([Id])    ON DELETE NO ACTION ON UPDATE NO ACTIONGO -- ---------------------------------------------------- Script has ended-- --------------------------------------------------


It is important to note that the tables weren't added to the database yet.  In order to actually create the tables you need to right click in the OrderDB.edmx.sql file and select Execute SQL from the pop-up menu.  You'll be prompted to log into the server that contains your database.  Once you are logged in the script will execute and the objects will be added to your database


Conclusion

That's all you need to do to create a database using the new Entity Framework's Model First methodology. This is a big improvement over the first edition because it allows you to use Visual Studio to work through the design of you objects first and then VS can figure out how to create the database tables, indexes, and relationships for you.




WCF RIA Service Hosting :: Error Message - Load Operation Failed for query "GetUser"

clock February 22, 2010 18:25 by author Administrator
Today, we are going to discuss a common issue that you may find when running WCF RIA service on a shared hosting server. ASPHostCentral.com, as the premier ASP.NET and Windows Hosting provider, proudly presents this article to anyone and we believe it will help many ASP.NET communities; especially to those who are using WCF RIA Service. In case you are looking for WCF RIA Service Hosting, you can always consider ASPHostCentral.com and you can start from our lowest Standard Plan @$4.99/month to host your WCF-service site.

One of the most common errors that you may find when running your WCF RIA Service on a shared hosting server is the error message:  
“Load Operation Failed for query "GetUser"

This is always an annoying issue with Silverlight deployment to do with connection strings and domain authorizations. Basically it’s a very generic error that pops up if you’re using the in-built standard asp.net model, such as the RIA services models of .net/silverlight development using aspnet authorization and registration.
There is a variety of reasons you will get the message popping up, but they all mean that your aspnet authorization calls (once of which is the GetUser call) are not able to contact the database that contains your aspnet data.


Common Reasons

- Your development system is using a local SQL Express database which works fine when your on your own machine, but once its online, it’s still trying to find the same LocalSqlServer or localhost, and obviously cant. You can get round this in your web.config, using stuff like:
     <remove name="LocalSqlServer" />    <add name="LocalSqlServer" connectionString="etc etc".>

- Or possibly you have all the connection strings point to the right places, but your new server database doesnt contain all the necessary aspnet tables/framework. Theres some tools that are located in your windows/.net folders, such as aspnet_regiis.exe, which if you search for online, you willl get details on how to use them to automatically configure/update an sqlserver with the all the necessary aspnet objects.

- You haven not deployed necessary references to the webserver, especially ones such as the System.Web.Ria, System.Web.DomainServices and System.ComponentModel.DataAnnotations. You can select them in your visual studio project and mark the Copy Local propery to True.- Also if you have any services mapped from server to client, such as WCF Services, make sure when your publishing to update their bindings/endpoint addresses in the client, as they will be still looking for those services on the localhost development server.

- Also make sure you use a valid crossdomain.xml and clientaccesspolicy.xml on your web project/deployment. If you do a websearch for these two filenames, you will get lots of examples of various settings to use that might be relevant to your site operation.

Theres also lots of other settings to tweak with your IIS settings that sometimes cause the issues, such as allowed IIS authentications such as anonymous, impersination, forms etc. Some servers run/allow multiple authentications that can cause issues with the aspnet operations of silverlight.

It’s a bit of a minefield, but basically as you can see the problem is a difficult one for so many silverlight developers because there can be so many solutions to fixing the issue.The other alternative that you can consider is you can use mix of setting of the correct IIS authentication allowing anonymous and forms, and making sure the default connection strings were update correctly. As for the stuff on our server, please (if possible) remove ASP.NET authorization from your application and please write your own custom authorization, so it’s not even trying to update the local sql server for the inbuilt ASP.NET stuff.

Hope this helps shed some light.


Reasons to trust your WCF-based website to ASPHostCentral.com

What we think makes ASPHostCentral.com so compelling is how deeply integrated all the pieces are. We integrate and centralize everything--from the systems to the control panel software to the process of buying a domain name. For us, that means we can innovate literally everywhere. We've put the guys who develop the software and the admins who watch over the server right next to the 24-hour Fanatical Support team, so we all learn from each other:

- 24/7-based Support - We never fall asleep and we run a service that is operating 24/7 a year. Even everyone is on holiday during Easter or Christmas/New Year, we are always behind our desk serving our customers
- Excellent Uptime Rate - Our key strength in delivering the service to you is to maintain our server uptime rate. We never ever happy to see your site goes down and we truly understand that it will hurt your onlines business. If your service is down, it will certainly become our pain and we will certainly look for the right pill to kill the pain ASAP
- High Performance and Reliable Server - We never ever overload our server with tons of clients. We always load balance our server to make sure we can deliver an excellent service, coupling with the high performance and reliable server
- Experts in WCF RIA Service Hosting - Given the scale of our environment, we have recruited and developed some of the best talent in the hosting technology that you are using. Our team is strong because of the experience and talents of the individuals who make up ASPHostCentral
- Daily Backup Service - We realise that your website is very important to your business and hence, we never ever forget to create a daily backup. Your database and website are backup every night into a permanent remote tape drive to ensure that they are always safe and secure. The backup is always ready and available anytime you need it
- Easy Site Administration - With our powerful control panel, you can always administer most of your site features easily without even needing to contact for our Support Team. Additionally, you can also install
more than 100 FREE applications directly via our Control Panel in 1 minute!

Happy hosting!
 


WCF RIA Service Hosting :: Error Message - This collection already contains an address with scheme http

clock February 22, 2010 17:49 by author Administrator
Today, we are going to discuss a common issue that you may find when running WCF RIA service on a shared hosting server. ASPHostCentral.com, as the premier ASP.NET and Windows Hosting provider, proudly presents this article to anyone and we believe it will help many ASP.NET communities; especially to those who are using WCF RIA Service. In case you are looking for WCF RIA Service Hosting, you can always consider ASPHostCentral.com and you can start from our lowest Standard Plan @$4.99/month to host your WCF-service site.

One of the most common errors that you may find when running your WCF RIA Service on a shared hosting server is the error message:

This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection.

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.ArgumentException: This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection.”

This error message can be retrieved on the Event Viewer window on the server. If you do not have an access to the server, you may contact your hosting provider to trace this error for you.


Solution:

This problem is caused by the fact that WCF only supports 1 IIS host header. Your hosting provider may have more than 2 host headers, namely www.yourDomain.com and yourDomain.com. Therefore, you may need to remove one of the host headers from the IIS.


Other Alternative Solution:

The other alternative solution you can consider is to create a separate .SVC file. The solution, since WCF services hosted in IIS can have only one Base Address was to create a custom service factory to intercept and remove the additional unwanted base addresses that IIS was providing. Your default IIS settings will have 2 entries of host headers, namely: www.yourDomain.com and yourDomain.com. You then need to customize your .svc file to specify a custom service factory. You are then able to create your custom factory by inheriting from ServiceHostFactory and overriding as required.The following is the code:

class CustomHostFactory : ServiceHostFactory
    {
        protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
              CustomHost customServiceHost =
                new CustomHost(serviceType, baseAddresses[1]);
            return customServiceHost;
        }
    }   

class CustomHost : ServiceHost

    {
        public CustomHost(Type serviceType, params Uri[] baseAddresses)
            : base(serviceType, baseAddresses)
        { }
        protected override void ApplyConfiguration()
        {
            base.ApplyConfiguration();
        }
    }

You need to pass through baseAddresses[1] (which was the www. address) but it would probably be wise to specify that address you want to prevent changes by your web host from impacting your code.Please refer to this article at http://blogs.msdn.com/rampo/archive/2008/02/11/how-can-wcf-support-multiple-iis-binding-specified-per-site.aspx for further information.


Reasons to trust your WCF-based website to ASPHostCentral.com

What we think makes ASPHostCentral.com so compelling is how deeply integrated all the pieces are. We integrate and centralize everything--from the systems to the control panel software to the process of buying a domain name. For us, that means we can innovate literally everywhere. We've put the guys who develop the software and the admins who watch over the server right next to the 24-hour Fanatical Support team, so we all learn from each other:

- 24/7-based Support - We never fall asleep and we run a service that is operating 24/7 a year. Even everyone is on holiday during Easter or Christmas/New Year, we are always behind our desk serving our customers
- Excellent Uptime Rate - Our key strength in delivering the service to you is to maintain our server uptime rate. We never ever happy to see your site goes down and we truly understand that it will hurt your onlines business. If your service is down, it will certainly become our pain and we will certainly look for the right pill to kill the pain ASAP
- High Performance and Reliable Server - We never ever overload our server with tons of clients. We always load balance our server to make sure we can deliver an excellent service, coupling with the high performance and reliable server
- Experts in WCF RIA Service Hosting - Given the scale of our environment, we have recruited and developed some of the best talent in the hosting technology that you are using. Our team is strong because of the experience and talents of the individuals who make up ASPHostCentral
- Daily Backup Service - We realise that your website is very important to your business and hence, we never ever forget to create a daily backup. Your database and website are backup every night into a permanent remote tape drive to ensure that they are always safe and secure. The backup is always ready and available anytime you need it
- Easy Site Administration - With our powerful control panel, you can always administer most of your site features easily without even needing to contact for our Support Team. Additionally, you can also install
more than 100 FREE applications directly via our Control Panel in 1 minute!

Happy hosting!
 


ASP.NET 4 Hosting :: CORE Services in ASP.NET 4 Framework

clock February 11, 2010 15:34 by author Administrator

Microsoft Visual Studio 2010 and the .NET Framework 4.0 are the next generation development tools and platform for Windows Vista, the 2007 Office System, and the Web. ASPHostCentral.com as the premier Windows and ASP.NET Hosting provider has supported .NET4 Framework in all our hosting environments. The cost to host your .NET4 website/project is priced  as low as $4.99/month ONLY.

On this articles, we will present you the CORE Services that you can find on ASP.NET 4 Framework. You can certainly get this all CORE features on any hosting plans you choose.

The Core Services space has a list of new features as well including simplifying the web.config file, permanent page redirection, session state size reduction, expanding the range of allowable URLs, auto-start Web applications, and the list goes on. We’ll touch on a few here.


Auto-Start Web Applications

Some Web applications have extensive initialization code in the Application_Load method in the Global.asax file that needs to be executed before a site can process its first request. The new Auto-Start scalability featured is aimed at resolving this problem when running ASP.NET 4.0 on IIS 7.5 and Windows Server 2008 R2. Cold-starting IIS 7.5 or recycling an application pool causes IIS 7.5 to reference the applicationHost.config file to determine which applications to restart. Marking an application as auto-start informs IIS 7.5 that ASP.NET 4.0 needs to be notified to start the application.

Adding the following to the applicationHost.config file configures the TakeNoteAppPool application pool for auto-startup.


<applicationPools>
  
<add name="TakeNoteAppPool" 
       
startMode="AlwaysRunning"  />
</applicationPools>

If your application pool contains more than a single application, you can specify which applications get auto-started with the applicationHost.config file in Listing 1. When ASP.NET is in the pre-start state, the type defined in the preloadProvider section of the applicationHost.config file has its Preload method fired.

namespace WhatsNew40
{
  
public class MyInitializationCode:
     System.Web.Hosting.IProcessHostPreloadClient
    {
        
public void Preload(string[] parameters)
        {
            
// Code to run on app start up
        }
    }
}

When the PreLoad method completes, the application is ready to process incoming requests. The new auto-start feature solves the problem of making sure your Web application is ready to accept requests before the first visitor arrives.


Shrinking Session State


Session state can be stored out of process on another server or within SQL Server. Both of these approaches require that the session state information be transmitted across the network to the receiving server. ASP.NET 4.0 introduces a way to reduce the size of that session data by compressing and uncompressing it with the System.IO.Compression.GZipStream class with the compressionEnabled setting.

<sessionState
  
mode="SqlServer"
  
sqlConnectionString="connection string here"
  
allowCustomerSqlDatabase="true"
  
compressionEnabled="true" />


Permanently Redirecting a Page

When you permanently relocate a Web page, you should return a HTTP 301 status code as well as a location header in the HTTP response of the relocated page. The HTTP 301 code will inform search engines and other user-agents that the page has permanently moved.

The new RedirectPermanent feature makes it easy to issue HTTP 301 status codes for permanently moved pages.

Response.RedirectPermanent("deadpage.aspx");


Extensible Output Caching

In its simplest forms, caching allows you to store generated HTML pages in memory. This speeds up response time when cache pages are requested since the entire page lifecycle for the page does not have to be processed. The problem with this approach is that all these items are being stored in your Web server’s memory-memory that may be at a premium for sites with heavy traffic volume

This new feature provides a way for storing those cached HTML assets in any storage mechanism you choose. A custom output cache provider is created as a class deriving from System.Web.Caching.OutputCacheProvider. A web.config entry in the new providers section of the outputCache element contains the details for your new class


Web.config Goes on a Diet

With all the features that have been added to ASP.NET over the years, it was inevitable that the web.config would swell in size. Add in the new features in ASP.NET 4.0 such as routing, AJAX, outputCaching Providers and so on, and the swelling continues. New to ASP.NET 4.0 is the moving of major configuration settings into the machine.config file with applications inheriting these settings.

This allows an application to simply not have a web.config file or to have a very simple one like this one specifying the framework version being targeted.


Listing 1: applicationHost.config file settings for Auto-Start

<sites>
  
<site name="MainSite" id="1">
    
<application path="/"
       
preloadEnabled="true"
       
preloadProvider="AutoLoadData" >
       
<!--  //Additional application settings here// -->
    
</application>
  
</site>
</sites>

  
<!-- //Additional settings here// -->

<preloadProviders>
   
<add name="AutoLoadData "
        
type="WhatsNew40.MyInitialzationCode, WhatsNew40" />
</preloadProviders>



ASP.NET MVC Hosting :: ASP.NET MVC Sample Applications, Open-Source Examples and Tutorials

clock February 10, 2010 16:07 by author Administrator

ASP.NET MVC is a free, fully supported, Microsoft product that enables developers to easily build great web applications. It provides total control over your HTML and URLs, enables rich AJAX integration, and facilitates test driven development.


Here is a list of various ASP.NET MVC Sample Applications demonstrating the new ASP.NET MVC Framework from Microsoft. If you like to have any of these applications hosted on a server, you can consider ASPHostCentral.com as your ASP.NET MVC hosting provider. With a package starting from only $4.99/month, you can have the latest ASP.NET MVC 2 RC framework running on our server.


CarTrackr

CarTrackr is a sample application for the ASP.NET MVC framework using the repository pattern and dependency injection using the Unity application block. It was written for various demos in presentations done by Maarten Balliauw. CarTrackr is an online software application designed to help you understand and track your fuel usage and kilometers driven. You will have a record on when you filled up on fuel, how many kilometers you got in a given tank, how much you spent and how much liters of fuel you are using per 100 kilometer. CarTrackr will enable you to improve your fuel economy and save money as well as conserve fuel. Fuel economy and conservation is becoming an important way to control your finances with the current high price


http://cartrackr.codeplex.com/


Codecampserver

This is the source code repository for CodeCampServer, a free, open source Code Camp management web application.

http://code.google.com/p/codecampserver/


Contact Manager

In this series of tutorials, Stephen Walther demonstartes how to use the ASP.NET MVC framework to build an entire Contact Manager application using unit tests, test-driven development, Ajax, and software design principles and patterns


http://www.asp.net/mvc/


FlickrXplorer

The project is an open source initiative to present users a fast photo explorer and search tool to browse millions of photos in flickr. The app is made with a bit of jQuery blend using Asp.net MVC and custom LINQ. The project also embodies a cloud computing scenario where the actual datastore lies millions of miles away invoked though simple API. The Application gives a nice starting point for Asp.net MVC, it also shows a strong integration of jQuery with Asp.net MVC as a client framework. It uses Athena (http://www.codeplex.com/LinqFlickr) LINQ to flickr API for fetching in and out data which is made on a custom LINQ provider toolkit made best for creating LINQ to Cloud APIs (http://www.codeplex.com/LinqExtender).

http://flickrxplorer.codeplex.com/


Kigg

KiGG is a Web 2.0 style social news web application developed in Microsoft supported technologies. The project uses ASP.NET MVC, Linq To SQL, MS Patterns & Practices Enterprise Library and Unity, jQuery, xUnit.net, Moq, HtmlAgilityPack, DotNetOpenId, and other 3rd party libraries


http://www.codeplex.com/Kigg


MVC StoreFront

I'm creating an ongoing series of webcasts and blog posts, documenting the building of an eCommerce storefront using ASP.NET MVC

http://blog.wekeroad.com/mvc-storefront/


Nerddinner

NerdDinner.com is an event management site so computer folks can meet and talk technology over a meal. It uses ASP.NET MVC along with jQuery, ASP.NET Ajax, Virtual Earth Javascript controls, and LINQ to SQL. It’s also a real site running at NerdDinner.com that you can use to schedule geek meet ups and nerd dinners in your neighborhood!

http://nerddinner.codeplex.com/


Oxite

Oxite is an open source, web standards compliant, blog engine built on ASP.NET MVC and LINQ To SQL. Oxite supports all the features we consider essential to a blog engine, including the MetaWebLog API (to allow you to use LiveWriter or similar tools to add/edit your posts), trackbacks, pingbacks, Sitemaps (for search engines), RSS and ATOM feeds (at the site, blog, tag and post level ... plus feeds of all new comments... great for the site owner), tags, integrated search, web based admin features (including editing posts, your site settings, etc.), email subscriptions for new comments, basic support to publish 'pages' (non-blog content) and more.

http://www.codeplex.com/oxite



Silverlight 3 Hosting :: RIA Services - RAD for the Middle Tier

clock February 8, 2010 18:26 by author Administrator

RIA Services is a new Microsoft framework for developing n-tier Line of Business (LoB) applications. RIA Services make it easier to build Silverlight applications that communicate with a server, which is the focus of this article. As a developer, RIA Services provides automatic code generation for common scenarios where you need to perform CRUD operations on data and have a consistent model to validate data across tiers. The following sections explain how to get started with RIA Services, specify a data source and a UI, and automatically generate code for CRUD operations. Let me show you the big picture of RIA Services from an architectural perspective first

ASPHostCentral.com is the premier ASP.NET Hosting Provider which supports Silverlight 3 and RIA Services. You can start creating your first RIA Service project online from as low as $4.99/month ONLY! You can check our various Silverlight Hosting Plans by visiting our website directly at
http://www.asphostcentral.com


Understanding RIA Services Architecture

RIA Services solves problems in n-tier application design for Silverlight applications by making it easier to serialize and stream objects across a network, sharing common validation among tiers, and automating asynchronous communication. To compare current development practices to what RIA Services offers, consider a common architecture, shown in Figure 1, using Web services to allow a Silverlight application to communicate with the server


Figure 1. N-Tier architecture with Web services


To the left of Figure 1 is a Silverlight control in a browser, which is the presentation tier. Following the network connection to the right, the Web service resides on the server, which is a separate tier where Business Logic Layer (BLL) and Data Access Layer (DAL) code reside; the sidebar, Layers and Tiers, explains the difference between layers and tiers.

LoB application development is very much about managing data properly. In the Web services scenario in Figure 1, you can see how data management must be handled in each tier. Perhaps you have a framework that makes it easier to stream data across the wire, but you still have manual work to do in each tier to manage CRUD operations

Observe in Figure 1 the separate validation code in each tier of the application, because in many cases you can’t make the assumption that presentation tier validation is sufficient. Especially in a Web services scenario, any client can send bad data

A common problem with network communications is timeouts and managing perceived performance in the presentation tier in the face of latency. A common way to handle this is via asynchronous calls where your thread returns to the UI immediately and the application later handles the return thread from the Web service and marshals the call back onto the UI thread to update the screen. There are patterns and framework support for managing this, but you must write the code yourself. The solid line between tiers demonstrates the fact that communication is synchronous by default

“Up to now, developers have been fortunate to have the tools to build sophisticated n-tier architectures easier than earlier generations of software technology. However, this scenario becomes even easier with RIA Services.”

Up to now, developers have been fortunate to have the tools to build sophisticated n-tier architectures easier than earlier generations of software technology. However, this scenario becomes even easier with RIA Services. Figure 2 shows how RIA Services simplifies data management, validation, and communications


Figure 2: RIA Services architecture.

The single Data Objects block in Figure 2 demonstrates that the UI and BLL/DAL tiers use the same objects. RIA Services supports LINQ to SQL, ADO.NET Entity Framework, and POCO out of the box, reducing the amount of work that you must do to move data across the network. Similarly, Validation has a single block, showing that the same validation rules defined in the BLL will be used in the UI. RIA Services build a proxy for the UI layer to encapsulate asynchronous communication, represented by the dashed line between UI and middle tier, freeing you from the extra coding

The rest of this article shows you how RIA Services can help reduce the amount of code you write for n-tier LoB applications, starting with an explanation of how to start a Silverlight project that uses RIA Services


Starting RIA Services in a Silverlight 3 Project

The easiest way to use RIA Services is via the Silverlight Application wizard in Visual Studio 2008. The following steps will walk you through the process of creating a Silverlight application that uses RIA Services. For this article I’ll use a C# project, but you can do the same with a Visual Basic project:

1. Start a new Silverlight application by selecting File | New | and Project. You’ll see the New Project window in
Figure 3
2.
Select Visual C#, select Silverlight in Project types, and select
Silverlight Application in Templates
3.
Set Name to RIAServicesDemo, specify the Location where you want the project to reside, and click OK. You’ll see the New Silverlight Application window in
Figure 4


Figure 3:
New Project window.



Figure 4: New Silverlight Application window.

If you’ve built Silverlight applications before, the New Silverlight Application window in Figure 4 will be familiar. The Host the Silverlight application in a new Web site check box creates a new ASP.NET Web site with sample pages containing the new Silverlight control. You can change the project name to anything you like, but this demo will use the default. This demo will also use the default of ASP.NET Web Application Project as the project type; the alternative being an ASP.NET Web Site project. What’s new, for Silverlight 3, in the New Silverlight Application window is the Link options section. To use RIA Services, you must check the box for Link to ASP.NET server project, which establishes the proper assembly references and any other settings required for using RIA Services. If you forget to check the Link to ASP.NET server project box and change your mind later, you can open the Properties window for the Silverlight project and there is an option called ASP.NET server project link on the Silverlight tab that you can change

4. Click OK to create a new solution with a Silverlight application project and an ASP.NET project, shown in
Figure 5




Figure 5:
New RIA Services application solution.

A couple items in Figure 5 are worthy of mention: assembly references and Toolbox controls. Notice that the Silverlight project, RIAServicesDemo, includes a reference to System.Windows.Ria; the assembly containing RIA Services types. In addition, you can see several new controls in the Toolbox such as DataForm, DataPager, and DatePicker that are new in Silverlight 3



RIA Services supports multiple types of DAL in your architecture, including LINQ to SQL, LINQ to Entities, or custom.”




ASP.NET 4 Hosting :: What's NEW in Visual C# 4.0?

clock February 7, 2010 15:17 by author Administrator

Visual C# version 4.0 offers new features that make it easier for you to work in dynamic programming scenarios. Besides dynamic programming, you have support for optional and named parameters, better COM interop support, and contra-variance and covariance. This article will show you how each of these features work and provide suggestions of how they can be applied to help you be more productive.

To help you follow the path of C#, this article looks at the history of C#, today’s use of C#, and helps you understand the future of C# and what the language intends to provide for you. After you understand the theme of C# 4.0, you’ll learn about the new features of C# 4.0. Finally, this article will show you how to create a dynamic object of your own with late-bound calls to dynamic methods based on conventions.

C#: Then and Now

The previous major versions of C# were 1.0, 2.0, and 3.0. There was a minor version 1.1 in April of 2003, but it didn’t significantly change the theme of the 1.0 release.

Microsoft first announced C# on June 16th 2000. It was the first high-level programming language that was built specifically to target the .NET Common Language Runtime. C# 1.0 grew its heritage from C++, but borrowed features from languages such as Delphi, Java, and others. In C# 1.0, Microsoft planned to provide an object-oriented, component-based language that was very simple to use. When Microsoft released C# 1.0 to manufacturing on February 13th 2002, it was an immediate hit and steadily grew in popularity

When C# 2.0 rolled around, Microsoft finally added all of the features that should have been in C# 1.0. For example, generics was huge and is an important part of .NET development today. C# 2.0 also introduced anonymous methods, iterators, and nullable types. An interesting addition to C# 2.0, nullable types was a pre-cursor feature for what was coming in the next version, focusing on data

Most developers work with data, which was the primary theme of C# 3.0. The largest C# 3.0 language addition was Language Integrated Query (LINQ). Most other language features added in C# 3.0 were primarily to support LINQ, but the new features; including implicitly typed local variables, anonymous types, object and collection initializers, lambdas, and extension methods, can have value on their own in development that doesn’t involve LINQ

The next version of C# will be 4.0, which is the focus of this article. C# 4.0 will primarily focus on dynamic programming. The following sections of this article explain the dynamic programming features of C# 4.0 as well as other new features such as optional/named parameters and covariance/contravariance

Why Dynamic Programming?

The dynamic programming story in C# can fall into fulfilling categories of need in the way of multiple-language integration, simpler reflection, access to HTML DOM in Web scenarios, and easier COM interop. Some of these categories of need might not apply to your particular situation, and that’s okay because there isn’t anything that says that you have to use a language feature just because it’s there.

Most C# developers use multiple tools in a single application to accomplish complex tasks. If you’re writing WPF desktop applications, you’re using C# and XAML. It is quite possible that you might find some open source code that solves a problem, but it might be written in another language such as VB or F#. One of the benefits of .NET since its inception is the ability to have cross-language interoperability and the runtime is even called the “Common Language” Runtime (CLR). In recent years, Microsoft has created dynamic languages, such as IronRuby and IronPython, but developers don’t have an easy way to perform interop with dynamic languages. If you have this need, then you’ll welcome the ease with which C# dynamic programming makes interop between C# and dynamic languages possible

When performing reflection to run a method on an object, there are several hoops to jump through, including obtaining a reference to an object type, getting a reference to a member info object, determining the type of bindings to use, and then invoking the member. While reflection has an undeniable coolness factor, it still feels like a hack and that’s where C# 4.0 dynamic methods can help

If you write Silverlight applications, you might have the need today or in the future to access the HTML DOM containing your Silverlight control. C# dynamic programming makes this task easier

Performing COM interop with C# has always been cumbersome; partly because of the need to write extra syntax for conversions, optional parameters, and more. This has left some C# developers with a touch of VB envy because VB has easier COM interop support. One of the purposes of dynamic programming in C# is to help the C# programmer write cleaner syntax in COM interop scenarios

Where do you go for Visual C# 4.0 Hosting?

Basically, you need to look for a host that supports ASP.NET 4.0 Hosting. ASPHostCentral.com is the premier ASP.NET 4 Hosting provider and you can always start from as low as $4.99/month to host your first Visual C# 4.0 project.








ASP.NET 4 Hosting :: URL Routing in ASP.NET 4 Framework

clock January 28, 2010 22:05 by author Administrator
URL routing was a capability we first introduced with ASP.NET 3.5 SP1, and which is already used within ASP.NET MVC applications to expose clean, SEO-friendly “web 2.0” URLs.  URL routing lets you configure an application to accept request URLs that do not map to physical files. Instead, you can use routing to define URLs that are semantically meaningful to users and that can help with search-engine optimization (SEO).

For example, the URL for a traditional page that displays product categories might look like below

http://www.mysite.com/products.aspx?category=software


Using the URL routing engine in ASP.NET 4 you can now configure the application to accept the following URL instead to render the same information:

http://www.mysite.com/products/software

With ASP.NET 4.0, URLs like above can now be mapped to both ASP.NET MVC Controller classes, as well as ASP.NET Web Forms based pages.  You can even have a single application that contains both Web Forms and MVC Controllers, and use a single set of routing rules to map URLs between them.

ASPHostCentral.com proudly announces that we are the first host to offer ASP.NET 4 Hosting with support of Entity Framework 4 to all our new and existing customers and you can start using this newest server from just as low as $4.99/month.

Response.RedirectPermanent() Method

It is pretty common within web applications to move pages and other content around over time, which can lead to an accumulation of stale links in search engines

In ASP.NET, developers have often handled requests to old URLs by using the Response.Redirect() method to programmatically forward a request to the new URL.  However, what many developers don’t realize is that the Response.Redirect() method issues an HTTP 302 Found (temporary redirect) response, which results in an extra HTTP round trip when users attempt to access the old URLs.  Search engines typically will not follow across multiple redirection hops – which means using a temporary redirect can negatively impact your page ranking.  You can use the SEO Toolkit to identify places within a site where you might have this issue

ASP.NET 4 introduces a new Response.RedirectPermanent(string url) helper method that can be used to perform a redirect using an HTTP 301 (moved permanently) response.  This will cause search engines and other user agents that recognize permanent redirects to store and use the new URL that is associated with the content.  This will enable your content to be indexed and your search engine page ranking to improve

ASP.NET 4 also introduces new Response.RedirectToRoute(string routeName) and Response.RedirectToRoutePermanent(string routeName) helper methods that can be used to redirect users using either a temporary or permanent redirect using the URL routing engine.  The code snippets below demonstrate how to issue temporary and permanent redirects to named routes (that take a category parameter) registered with the URL routing system.

You can use the above routes and methods for both ASP.NET Web Forms and ASP.NET MVC based URLs

Summary


ASP.NET 4 includes a bunch of feature improvements that make it easier to build public facing sites that have great SEO.  When combined with the SEO Toolkit, you should be able to use these features to increase user traffic to your site – and hopefully increase the direct or indirect revenue you make from them



Technology