2016-02-25 77 views

回答

1

Rupesh你可以從控制器請求與webclient的PHP頁面,並在mvc視圖中呈現結果html嗎?

public ActionResult displayPHPPage(string url) 
    { 
     using (var client = new WebClient()) 
     { 
      string response = client.DownloadString(url); 
      return View(response); 
     } 
    } 
+0

謝謝mwwallace8,這工作得很好。 –

+0

如何在我的mvc項目中包含php頁面,然後直接從那裏調用它,而不是調用php頁面所在的url。 –

+0

我不認爲MVC視圖引擎支持服務.php文件,即使你的web服務器上有php。我發現這個,但看起來很老。 https://phpviewengine.codeplex.com/ –