ASP.NET - PHP to ASP.NET conversion

Asked By user 220 on 02-Jun-11 02:18 PM
I am trying to convert a php website to asp.net one. The place I am stuck is the <?include()?> script of PHP.
For example I would like to convert the below line to ASP.NET version.

<?php include("includes/toplinks.aspx"); ?>

When I looked on web it showed me that "<!-- #include file|virtual="filename" -->" is an equivalent to PHP's include. But it does not work when I try to do that.

Any suggestion would be of great help.

Thanks.
Kirtan Patel replied to user 220 on 02-Jun-11 02:41 PM
master page is some what equivalent to your include directive in php use master page in asp.net

Nikhil Mahajan replied to user 220 on 02-Jun-11 09:56 PM
You can however convert PHP to source code that can be compiled.

microsoft have a PHP to ASP.NET covnersion tool you can download.

http://www.asp.net/downloads/archived/migration-assistants/php-to-aspnet/

 

It isn't great, but it does the job.

The resutl is more like ASP than ASP.NET code.
Riley K replied to user 220 on 03-Jun-11 12:48 AM

1. Download and install the PHP to ASP.NET 1.x Migration Assistant

The migration assistant download package is a 4MB self extracting zip file. We recommend that you save it to your local machine before unzipping it. After completing the download, unzip the file to a temporary directory. Follow the installation instructions in the GettingStarted_PHPtoASPNET.htm file located in the temporary directory.

http://download.microsoft.com/download/0/d/c/0dc4631e-8624-46e9-b87c-59c829b947f4/PHPConvert.msi

http://download.microsoft.com/download/0/d/c/0dc4631e-8624-46e9-b87c-59c829b947f4/PHPConvert.msi contain information on how to use migrate common PHP code samples to ASP.NET using the migration assistant.