I have been working for a long time with PHP, and tried to be as good as possible on it (good coding practices, knowing how every request is handled from the start to the end, etc.), but now, for job reasons I have to start learning ASP.NET and C#.

I've read and tried to understand it's foundations, as ASP.NET is always working with a given Framework called .NET, but there are so many versions, and different approaches like MVC or WebForms, etc.

I've made some tests, and I see that parts of the code get compiled, others not —don't know why—, and that a lot of shit is generated in the final HTML output.

I have the feeling of losing control over my WebApp, so my question is: Where can I start to understand how that works? Any tutorial, book, etc is welcome (as up-to-date as possible).

Is it possible to keep having control of the code with that Microsoft software, so the final output is clean, lightweight and high performance JS and HTML code?

For the C# part, I think this it is the easiest one, I'm just looking for a good book to read... I guess version 5.0. Am I right?

closed as off-topic by gnat, user53019, Bart van Ingen Schenau, user40980, user7007 Dec 13 '13 at 14:21

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, Community, Bart van Ingen Schenau, Community, Community
If this question can be reworded to fit the rules in the help center, please edit the question.

  • ASP.NET MVC might be a better fit for you. It is a bit closer to the metal, has a logical structure, and gives you complete control over the markup and client-side code. ASP.NET is meant for a different audience: Winforms developers transitioning to web development. – Robert Harvey Jul 11 '13 at 16:09
  • I also moved from PHP to ASP.NET/C# and I was in the same boat as you. Not seeing what was happening bugged me. But .NET is a robust framework and is backed by a large community. So it's ok to "trust the magic" to some extent. I wouldn't mitigate the importance of understanding the concepts of what is happening behind the scenes, but the framework makes it possible to focus on the big picture and what is arguably more important, getting the job done. Once I realized I could build a system in a week that used to take a month or more, I was ok with relinquishing a little control. – LoganGoesPlaces Jul 11 '13 at 18:02
  • Also, I'm not sure if you will have as much of an issue as I did, but one of my biggest hangups was the ASP.NET life-cycle. I can't tell you how much time I spent trying to access controls one the page and banging my head on the keyboard because the code couldn't find them. – LoganGoesPlaces Jul 11 '13 at 18:08
  • The auto-generated JS, Viewstate, etc is still a bummer though. The source of an aspx page is definitely a mess. – LoganGoesPlaces Jul 11 '13 at 18:12
  • I wouldn't touch webforms if I were you. MVC is a huge improvement. – The Muffin Man Jul 11 '13 at 18:52

Classic ASP existed before the .Net framework and thus is a separate technology that often used a Scripting variation is something to note just in case someone wants to know what is ASP .

While there is the story of classic ASP, early versions of the .Net framework, there is something to be said for what job reasons do you have to learn ASP.Net, which is different than classic ASP, and C#. There is also VB.Net that can be used in ASP.NEt so ASP.Net as a platform does support more than one language.

Rather than worry over "losing control", I'd suggest you learn about the merits of different approaches as ASP.Net MVC is quite different from WebForms though both have their advantages and disadvantages. For new development, MVC is probably a better selection though if you are going to be supporting existing applications then you may have to learn WebForms and these are rather different.

Understanding how it all works would likely take you a long time and in that time new versions would be born as there is something to be said for ASP.Net 1.0, 1.1, 2.0, and 4.0 on the web side of things never mind the versions of C# that also get enumerated in their own way.

Depending on how you want to define "clean, lightweight and high performance JS and HTML code" there are tons of ways you can build this. In one of my previous jobs, a co-worker often used primitives so that he didn't use the built-in ASP.Net controls at all and stuck with hand-coded JavaScript and HTML for the most part that worked within his architecture. Others may prefer to use the built-in controls that have their trade-offs.

Last but not least, don't forget that C# can also be used within WinForms, WCF services and a bunch of other platforms beyond the web. I'd probably suggest going through MSDN's tutorials as a starting point.

  • 1
    I really thing new developers should be directed towards ASP.NET MVC and not web forms or classic asp. While web forms is still used MVC is more actively developed and frankly makes more sense. – Benjamin Gruenbaum Jul 11 '13 at 16:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.