2

In regards to web development PHP works seamlessly embedded inside HTML pages and is parsed before the HTML itself (hence the name PHP!). I'm thinking of starting to learn ASP.NET and C# and it greatly boggles me how do these two Microsoft technologies work in tandem when compared to PHP which is a single entity in itself. I still can't understand how any logic written in C# files is tied to HTML pages that contain ASP.NET scripts.

And yes, if PHP is a scripting language, are C# and ASP.NET too server-side scripting languages??

2
  • ASP.NET is a web-development framework on top of .NET, and C# is not really a scripting language, though it does run server-side Commented Mar 11, 2011 at 7:19
  • 2
    Hello and welcome to Stack Overflow. However, this is not the type of question to be posed here. This is not a question that needs others to solve and is easily researched. Commented Mar 11, 2011 at 7:20

1 Answer 1

2

I will explain in a rather unconventional way, but I think this makes it easier to explain and understand.

The C# code is compiled, usually one class per page. The ASP.NET part is compiled into a class derived from the C# class.

The web server calls some function in the class to start the create the page.

Simplified it works like this:

  1. Having Page class and PageSource class where Page is derived from PageSource.
  2. Server creates an instance of Page and calls Start() on it.
  3. Start() calls the relevant functions to process the request.
  4. Some of the functions in Page output the HTML. Some call functions in PageSource.
  5. Finally after all the HTML has output, the output is sent to the client.

Refer to ASP.NET Page Life Cycle for more info.

Sign up to request clarification or add additional context in comments.

Comments

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.