views:

303

answers:

8

For months, I've been considering downloading Microsoft's express web platform and learning ASP.NET, which I might actually enjoy, seeing as I already do web work with PHP, but am much more comfortable with C#.

However, the primary reason I don't want to do this is that I've always associated ASP.NET with useless spaghetti HTML. The link I posted is an excellent example. Would it be possible to use ASP.NET in a context more similar to PHP, using it to power my site but not leaving the HTML, CSS, and JavaScript to be done by hand for validation and semanticity reasons?


EDIT

I've decided I'm not going to learn ASP.NET and stick with PHP.

While MVC sounds nice, for me it will likely end up being a development/debugging headache.

+25  A: 

Things get much better if you use ASP.NET MVC. I recommend you skip ASP.NET WebForms and jump to MVC directly.

pgb
I started looking at the MVC website, but left because it required Silverlight. Now I'm wondering if MVC is powered by Silverlight as well.(Basically, in my book, Silverlight is a big no-no.)
MiffTheFox
No, MVC does not need silverlight.
Joel Coehoorn
MVC and silverlight have nothing to do with each other.
CSharpAtl
silverlight is MS's version of flash, and the two are soon to be tantamount. unless flash is a big no-no to you, you shouldn't discredit silverlight. also, MVC and silverlight are completely unrelated.
Jason
@Jason Flash is also a big no-no.
MiffTheFox
+1  A: 

you're really going to want to check out the asp.net mvc. it allows you to develop in a manner a lot more suited for the web than vanilla webforms.

+1  A: 

First of all, ASP.Net, even using webforms, does allow you to have complete control over the markup output. Of course it's easier for some cases than others, but anywhere you find you're not getting the html you want out of a control you can always replace the render behavior with a ControlAdapter.

That said, as others have mentioned you'll probably find it's much easier to get the exact html markup you want using ASP.Net MVC.

Joel Coehoorn
+1  A: 

MVC.net and WebForms are built upon ASP.net

You can get a decent amount of control with webforms by disabling viewstate and not using any controllers (or very few). Its all in how much you let it do for you

Allen
+2  A: 

If you are going to use Classic ASP.NET Web Forms, you really need to learn how it works to avoid truely ugly html. If you know what you are doing, you can get close to what you want (you can't completely get rid of ViewState & it will do some ugly thing with element IDs)

A lot of the ugliness of Classic ASP.NET occures when people write web forms like they wrote VB 6 Windows applications.

ASP.NET MVC is a good option. It may be the way to go as a starting point; I would like to switch to it myself. I guess my point is that you can get less ugly HTML using Classic ASP.NET.

jrcs3
you can dev asp.net without viewstate
Allen
yes but out-of-box asp.net does generate a lot of bloat, so if you want full control, you wasting time configuring asp.net controls todo what you want, i really hate it... but love .NET, so MVC is awesome!
Sander Versluys
You can get rid of viewstate. You can also get rid of all the .Net controls. There's nothing stopping you from just response.write-ing out all your HTML Code. I've seen many applications in .Net that do exactly this. Just have a single function call, and no HTML in your .aspx file, and spit out all the HTML using response.write in the code behind page.
Kibbee
I guess I was refering to ASP.NET Web Forms. ASP.NET MVC is an example of using ASP.NET without using Web Forms.
jrcs3
+1  A: 

If you are looking to acquire skills in the latest and greatest, then MVC is where you should start but I would also consider whether you will ever be asked to support ASP.Net Webforms. Having an understanding of ViewState is crucial to that end.

For fine grained HTML output, you can produce this in many different ways with classic ASP.Net. There is a growing group of developers who are using a mixture of ASP.Net and microtemplating with Javascript to produce RIA's. This inevitably leads to keeping your html output cleaner so that it can be manipulated with jQuery and CSS.

David Robbins
A: 

Learn ASP.NET MVC as it will give you more control over the html generated. Also learning ASP.NET will increase your job opportunities significantly.

Jeffrey Hines
A: 

My first real development in ASP.NET was with MVC, and I must say I truly miss it now that I'm onto the next project using webforms. Each has it's place and webforms is working pretty well for what I'm doing (also using it as an opportunity to learn about TableAdapters and what not) but I really do miss being able to insert the data I need right into the HTML. That way I know the layout I've built won't get screwed up.

As a framework I enjoy ASP.NET quite a bit, but the controls on the page seems so far removed from anything resembling HTML that there is often a mental disconnect with what I'm typing with what I'm expecting to see. I was that way when I first started HTML though, so I imagine I'll get used to it. When I started with MVC it was overall a much more enjoyable experience coming from a front-end background.

dhulk