You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
On p.271 it says, "Besides master pages, themes, and skins, ASP.NET 4 has another feature that enables you to create reusable and thus consistent blocks of information: User Controls".
Are these also ways of centralizing the presentation and separating it from the processing? When is it important to this?
Are these also ways of centralizing the presentation and separating it from the processing? When is it important to this?
Yes. User Controls enable you to build a block of presentaton and logic you can reuse throughout the site. For example, you can create a contact form you can add to multiple pages. Then when you update the UC, all pages that use that UC are updated automatically. This way you can centralize presentation and behavior and minimize the need to write the same functionality twice.
I truly enjoy reading this book because it has lots of references on how to centralize the presentation and focus on code re-use. As I'm reading each chapter, I'm finding all the examples on pushing the formatting/layout to
CSS files and Master Pages very helpful.
My last real-world project was using classic ASP and I remember that maintaining the code was difficult because the presentation and processing were all mixed in one file.
I'm currently reading the chapter on AJAX and your articles on N-Layered Web Applications with ASP.NET 2.0.
Would it be correct to say that...
(1) Master Pages, CSS, Themes, Skins, and User controls are all ways to centralize the presentation?
(2) Encapsulating the business logic using well-defined classes is a way to centralize the processing?
(1) Master Pages, CSS, Themes, Skins, and User controls are all ways to centralize the presentation?
(2) Encapsulating the business logic using well-defined classes is a way to centralize the processing?
Yes, that would be correct indeed. You could also centralize behavior in, say, the code behind of a User Control but even then it would be better to encapsulate it in a separate class for further reuse (if you have the need).
Quote:
I truly enjoy reading this book because it has lots of references on how to centralize the presentation and focus on code re-use.
Thank you. That was one of my main goals. It's easy to write a mess in Web Forms as well, but I wanted to show ways to avoid or at leats minimize that....
It's been a while since I've been in the job market, but is N-Layered Development, Separating the presentation from the processing, Centralizing presentation/processing... Are these all things I can highlight as strengths on my resume?
Or is it assumed you will be doing these things using the WebForms model of development?
I've seen a lot of spaghetti implementations with Web Forms with Code Behind pages of hundreds or thousands of lines of code. So, it's not something everybody does and as such can be a good strength on a resume...