Converting traditional asp.net website to Umbraco - newbie question Options
dolberdinho
Posted: Wednesday, August 20, 2008 10:40:20 AM
Rank: Newbie

Joined: 7/4/2008
Posts: 6
Location: Copenhagen, Denmark
Hi,
I have a .net website made in visual studio 2005 with the following folder structure:
App_Code
App_Data
Bin
and then a bunch of .aspx files with .cs code_behind files

App_data contains a .mdf database file that I use as test db for my published website.
App_code contains .cs (C#)and .xsd (dataset) files.

I'd really like to migrate my website to umbraco so I can benefit from all the CMS stuff but I'm uncertain what's the best way to go about it.

From one post I can see that I can just copy the app_code folder to my umbraco site, so that part should be easy. Maybe the same applies for the app_data folder.

Must I convert all my .aspx files to .ascx files and then copy them to the umbraco usercontrols folder in order to make them into macros? And will these macros work if if copy the code_behind files along or do I need to convert them into .dll files (as I've read here)?


If anyone have a few hints about getting around such a conversion, please let me know.

BR,
Johannes
warren
Posted: Wednesday, August 20, 2008 1:32:17 PM

Rank: Addict

Joined: 7/19/2006
Posts: 820
Location: Benfleet, Essex, UK
Hi Johannes and welcome to Umbraco.

You will need to convert the aspx pages into HTML templates, you can use inherent so you don't have to keep writing out the same HTML.

Along with this you will need to create document types to allow you to use your data.

For example if you have a contact form on an ASPX page you will need to put the contact form functionality into a usercontrol (.ascx) but the rest will be handled by the html in your template.

I am probably not explaining this too well at the minute, but I would recommend my website starter wizard, it will install an entire website into an empty umbraco installation.

From there you can take a look around and see how things relate to one another and try to modify things for yourself to learn umbraco, that's the best way in my opinion.

To install my wizard once you have installed a new version of umbraco, login into umbraco goto the Developers section.
Right Click Macros
Select Import Package
Select Open the Repository
Select Website Packages
Select Creative Web Site Package

And follow the steps from there.

I hope that helps you, if not come back and ask more questions :)
Warren



Warren Buckley an Umbraco MVP 08-09 & level 1 certified developer
dolberdinho
Posted: Friday, September 05, 2008 11:36:29 AM
Rank: Newbie

Joined: 7/4/2008
Posts: 6
Location: Copenhagen, Denmark
Hi Warren,
thanks for the input - it got me going. I'll just write what I did in case it could be of help to others.

I installed the website wizard.

In order to get an .aspx page displayed:
1) I converted the aspx page to a usercontrol (.ascx) and placed it along with the codebehind file in the "usercontrols" directory.
2) I created a macro (developer --> macros) based on the Net control(.ascx) file. I checked the "use in editor" option. dont know if that is required, though.
3) created a template with "main" as the master template with the following syntax:

<?ASPNET_FORM>
<?UMBRACO_MACRO macroAlias="myUserControl" ></?UMBRACO_MACRO>
</?ASPNET_FORM>

4) I created a new document type with my newly created templete as the default.
5) I modified the "frontpage" document type's structure by adding my new document type to the "allowed child nodetypes".
6) I went to "content" and added a new child to "frontpage" based on my new document type and then I published the website.

I now had the user control showing.

By adding the app_code and app_data folder and adding the database connection string to the "web.config" file I have access to database and associated datasets (.xsd) files.

Br,
Johannes







Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.