Corporate Brochure

Keen to know about best web design & development company NewYork? Download our brochure here!

Categories
  • ASP.Net Development
  • CMS
  • Content Marketing
  • Custom Web Development
  • Digital Marketing Services
  • E-Commerce and Marketplace
  • Game Development
  • Guest Post
  • Migration Services
  • Mobile App Development
  • PHP Development
  • SEO/SMO
  • Sharepoint Development
  • UI/UX design

How to Migrate an ASP.NET Website to Sharepoint Site

Author : Pankaj Chopra Feb 22, 2017 Migration Services, Web Development
Migrate Website From Asp.net to Sharepoint

Do you have an ASP.NET site with an included CodeBehind? Do you feel the need to move this site to a SharePoint environment?

Ever since SharePoint is introduced in the market, a number of ASP.NET developers are shifting to SharePoint. The migration of websites can help you attain the migracy from legacy to modern. So, it is essential to seek the modernization of your website.

Your first option is to choose any of the best IT companies offering the SharePoint web development services and get your work done, hassle-free.

The IT companies delivering the website migration service Newyork can help you migrate your website with greater ease. But if you’re a developer or designer, you can do it yourself!

The good news is – there is no need to rework the website wholly to achieve this kind of migration.

Just follow these simple steps and you’re there:

Step 1: Creating just one DLL for your website by adding a web deployment project to it

Before you start with anything, make sure that you’ve added adequate namespaces. Also, avoid the duplications of the class name within a namespace.

The next thing is, you need to make sure that you’ve installed the Web Deployment Setup. If you’ve not already installed it, go for it first. Follow the next steps further:

  • Right-click your website project and choose the option of ‘Add Web Deployment Project’ to add the project to your website solution.
  • A very strong name key must be added to the website solution as it is used to sign every DLL.
  • By right- clicking on ‘Deployment Project’, choose ‘Property Pages’ to set the deployment project properties.
  • Now, open the ‘Output Assemblies’ tab and select the option of ‘Merge all assemblies to single assembly’. This option will be shown as a default option.
  • Provide the assembly name here.
  • Visit the signing tab and then select the option for ‘Enable Strong Naming’. Here, select the name key created in the above step.
  • Select the ‘Mark the assemblies with AllowPartiallyTrustedCallersAttribute (APTCA)’. Now, click the OK button. By this, the DLL will be turned to ‘partially trusted’ so that they can be used by your SharePoint site.
  • The assemblies that depend on the web application should be assigned strong names and so, one must use a very strong name key for say, Business Logic, Data access etc.
  • The partially trusted callers must be allowed for dependency DLLs. For this, you have to open the Class Library Project’s file – Assembly.info. You can use the code: [assembly: System.Security.AllowPartiallyTrustedCallers]
  • Your deployment project must be built under the Release Mode.
  • Now, visit the given path where an output is put by the deployment project. Here, you will be able to locate the DLL file for web deployment in the ‘bin’ directory. The DLLs for the dependency projects like Data Access Layer and Business Layer are also copied to the same ‘bin’ folder.

After this, you can access the DLLs that are used for your SharePoint site using the similar functionality like your ASP.NET website.

If you think that you’re unable to perform any of the things explained above, you can always seek any of the cost-effective website migration services Newyork.

Step 2: Copying the DLLs from the bin folder to your SharePoint site and using the copied DLLs by tweaked web configuration of this site

Now, in this step, you will have to link the above-created DLLs in your blank SharePoint website that already exists. Some changes are also to be made in the file named web.config, of the SharePoint website.

Follow the below-mentioned steps for the same:

  • First, you have to copy the contents from the ‘bin’ folder of your ASP.NET website to your SharePoint website’s ‘bin’ folder.
  • Now, go to your SharePoint site’s web.config file.
  • You need to add a code to the section called the PageParserPath, of the site which is mentioned below:
  • The assemblies required in your SharePoint website need to be registered as ‘SafeControl’. This can be done by adding the following code in the section called the Safecontrols:
  • Now, add every other dependency DLL that will be used by your site. Make sure to name these DLLs strongly and mark them as ‘AllowPartiallyTrusted’.
  • Trust level must be changed from Minimal to Medium and this can be done by moving the Trust section’s Level attribute from ‘WSS_Minimal’ to ‘WSS_Medium’.>

With this, you’ve accomplished your second step of your website’s migracy from legacy to modern.

Step 3: Importing web pages from the web application with SharePoint Designer:

  • Open the SharePoint site (created in the above step) in SharePoint Designer.
  • Go to File, then select Import, and then File. By this, you will get an Import Dialog Box.
  • Go to the ‘Add File’ option and select the ASPX page which has been created from the local folder. Make sure to pick the ASPX file instead of the ASPX page from the project. Now click the OK button. Your page will now be imported to the SharePoint site.
  • By double-clicking on the page that you just imported, select ‘Split’ from the option of ‘Design/Split/Code’. This is shown in the bottom left side of the center pane.
  • After this, your designer window will show an error saying: ‘The Master Page file is unable to load’. The error is shown because of the difference in the master file of the project and the one used for your SharePoint website. Here, you can use the default master page of SharePoint.
  • Now, in your web page’s ‘Page’ directive, change the ‘MasterPageFile’ attribute to a certain value similar to that of your SharePoint website’s default.aspx. This attribute is shown as masterurl/default.master.
  • In the next step, from the ‘Page’ directive, you need to remove the ‘CodeFile’ attribute because it is just for the purpose of Visual Studio.
  • For the placeholders of your ASP.NET web page, you have to change the ContentPlaceHolderID to an appropriate and relevant placeholder that will be used by your SharePoint site.
  • In the design view, the page will render with the default master page after the mapping of placeholders for your ASP.NET web page is done to master page of your SharePoint site.
  • Lastly, the ‘Inherits’ attribute is to be changed to add assembly name. An assembly should be in the SharePoint site’s ‘bin’ as we added in the above-mentioned Step 2.

With all these steps followed in the right direction, you will finally get your ASP.NET site migrated to that of your SharePoint site which is now ready to run with the same aspects as before!

If you want to save yourself from the hassle of doing the migration yourself, you can simply seek the assistance of any company or professional offering the website migration service Newyork. This will help you in a faster and faultless migration of your website!

About the Author

Pankaj Chopra is the dynamo in the web development activities held at SoftProdigy. With an experience of more than 10 years in web development, he has delivered his expert services on countless projects.
Pankaj loves to keep his genius mind well-fed with the newest web development technologies and trends. Thus, he has been successful in shaping the online presence of many businesses with his brilliant work. A wise leader, Pankaj never fails to design the best web development strategies for his team and clients.

Leave a comment

OUR RECENT POSTS

coffe-mug
Get latest tech updates straight to your inbox!