Should I learn ASP.NET if I prefer to have fine-grained control over my site HTML?

For several months I have been considering downloading the Microsoft Express Web Platform and learning ASP.NET, which I really liked as I already work on the web with PHP, but I am much more comfortable with C #.

However, the main reason I don't want to do this is because I've always associated ASP.NET with useless HTML spaghetti. The link I posted is a great example. Is it possible to use ASP.NET in a more PHP-like context, using it to include my site, but not leaving HTML, CSS, and JavaScript by hand for justification and semantics?


EDIT

I decided I would not learn ASP.NET and stick with PHP.

While MVC sounds good, it will most likely be a development / debugging headache to me.

-2


a source to share


8 answers


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



+25


a source


If you are going to use classic ASP.NET Web Forms, you really need to learn how it works to avoid the true ugly html. If you know what you are doing, you can get close to what you want (you cannot get rid of the ViewState entirely and it will do some ugly stuff with item IDs)

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



ASP.NET MVC is a good option. This can be a starting point; I would like to switch to it myself. I guess what I mean is that you can get less ugly HTML with classic ASP.NET.

+2


a source


you will really want to check out asp.net mvc. it allows you to develop in a much more web-friendly way than vanilla web forms.

+1


a source


First of all, ASP.Net, even using web forms, allows you complete control over the markup output. Of course, in some cases it is easier than others, but wherever you are you don't get the html you want from the control, you can always replace the rendering behavior with a ControlAdapter.

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

+1


a source


MVC.net and WebForms are built on ASP.net

You can get a decent amount of controls with web forms by disabling the viewstate and not using any controllers (or very few). Its all about how much you let it do for you

+1


a source


If you want to acquire skills in the very latest and greatest, then MVC is where you should start, but I would also consider if you would ever be asked to support ASP.Net Webforms. Understanding the concept of ViewState is critical to this goal.

For fine-grained HTML output, you can create this in a variety of ways using classic ASP.Net. There is a growing group of developers who use a mixture of ASP.Net and microtemplating with Javascript to produce RIA . This inevitably results in your html cleaner being rendered in a way that can be manipulated with jQuery and CSS.

+1


a source


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

0


a source


My first real development in ASP.NET was with MVC, and I have to say that I really missed that now when I move on to my next project using web forms. Each of them has a place and webforms works very well for what I do (also use it as an opportunity to learn about TableAdapters and what not), but I really miss the ability to insert the data I want into the HTML. This way I know that the layout I have built will not get confused.

As a framework, I really like ASP.NET, but the controls on the page seem so far removed from anything that resembles HTML that there is often a mental breakdown with what I type with what I expect to see, I was like this when I first started writing HTML, so I guess I'm used to it. When I started with MVC, it was an overall much more enjoyable experience coming from the frontal background.

0


a source







All Articles