简体   繁体   中英

Does ASP.NET accept PHP as main coding language

Good evening everyone, at the moment I make websites on apache using PHP (and obviously html, css, etc.).

I'm looking forward to moving to ASP.NET and Ajax in particular, and my problem is that I'm not completely sure about coding language to choose. MS Visual Web Developer suggests using Visual C and C#, but I read that I can also use PHP if the server is configured appropriately.

My question is - should I use Visual C/C# to implement dynamic page updates (actually it's the only reason I want to use Ajax for) or is my knowledge of PHP and jQuery sufficient (eg I'll simply move my PHP-based website to the new ASP.NET server and change only the places I want dynamic updates in)?

I'm sorry if the question and the description are ambigious... I'll be happy to add more information if required.

You're confusing IIS (Internet Information Server) with ASP.NET - the server-side ecosystem from Microsoft. IIS is equivalent to the the Apache web server. It can host many different web frameworks. ASP.NET is a specific, Microsoft-developed framework that uses C# or Visual Basic and provides the underlying framework for generating web pages in those languages. Yes, you can use PHP with IIS; no, you can't use PHP with ASP.NET without some sort of adapter that allows you to call methods on .NET objects.

If the only reason to make use of ASP.NET is to use AJAX, then you're in luck. You can use AJAX directly with PHP. AJAX is simply another way of making a web request, in this case an XMLHttpRequest instead of a full page request. But, a PHP web site will respond to this request as if it were just another web request, returning HTML or JSON (or XML if you really want) depending on how you implement the script.

Here are a few links on using AJAX with PHP (I have not vetted these, simply used Google). They may or may not use jQuery. For the client-side AJAX, the jQuery API docs should be sufficient ( http://api.jquery.com ).

No, not without a fair amount of effort anyway. ASP.NET runs on the .NET platform, so it requires some CLI language—eg C#, VB.NET, F#, etc.

Now there are lots of languages which target the CLI and compilers for non-CLI languages which target the CLI. For PHP there's Phalanger , which allows you to compile PHP down to CLI byte code so it can be run on ASP.NET.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM