0

I need to integrate a PHP page in an ASP.NET MVC4 application, so that i can render that page in the view.

I have referred this link. http://forums.asp.net/t/1853162.aspx?Integrating+PHP+pages+into+ASP+NET+MVC+3+appication+and+deploying+on+IIS+7

and included the php page in the application. However not sure about the further steps.

1 Answer 1

1

Rupesh can you just request the php page with webclient from a controller and render the resulting html in an mvc view?

    public ActionResult displayPHPPage(string url)
    {
        using (var client = new WebClient())
        {
            string response =  client.DownloadString(url);
            return View(response);
        }
    }
Sign up to request clarification or add additional context in comments.

2 Comments

How do i include the php page in my mvc project and then call it directly from there, instead of calling a url where the php page is being hosted.
I don't think the MVC view engine supports serving .php files even if your web server has php on it. I found this but it looks old. phpviewengine.codeplex.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.