2

I have a small website written in asp.net c#. It consists of 7 pages or less and a master page, connected to a database and references a class library. How to convert it to a visual web part in SharePoint 2013? My colleague advised me of copying the codes from the website solution to a visual web part solution as long as my website solution targets .Net framework 4.0. The question is, is his suggestion feasible? are there any other ways of doing it besides iframes and my colleague's suggestion?

Take into consideration I'm new to SharePoint development and I'm using visual studio 2012.

  • It depends on what the website is all about, if it contains custom forms than Visual Web Part will be good option.. If it contains CMS pages, than maybe you can create Page Layouts with Content Type combination to create all the pages.. – Arsalan Adam Khatri Oct 28 '14 at 17:30
  • Let's say my website contains custom forms, so it'd work if each page of the website is copied into a separate visual web part? What about the master page and the class library? – ELS Oct 28 '14 at 17:45
  • You would need to analyze your database driven code a bit more in detail. If you want to retain logic to access the 3rd party database, the database access strategy comes in to play here. – Roman Oct 28 '14 at 22:45
2

Following are high level steps you need to follow

  1. Convert Master Page into SharePoint format.
    • Create an HTML file with the same look and feel as your existing master page
    • Upload CSS/IMAGE/JS into SharePoint Site Assets Library
    • Reference those files in the master page
    • Upload the html file and use Design Manager to convert it into SharePoint master page
  2. Converting back-end (If you want to keep the existing back-end then skip this step)
    • If you are storing data in SQL etc. Then design those tables as SharePoint List
    • Update DAL to use SharePoint List (CRUD operations)
  3. Take each Page, and for each page add a new Visual WebPart to the solution. Convert code etc.
  4. Deploy the solution. This will install all webpart to the Farm
  5. Create Pages and add those visual web part
  • What if my master page contains logic for example, I need it to check the current sharepoint user and then check the users table in the database to enforce permissions according to each user's role. and what about the class library? As for step 5, so for each web part there will be a page? – ELS Oct 30 '14 at 4:22
  • In addition, what to do with Global.asax? Is there something similar in sharepoint? – ELS Oct 30 '14 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.