 |
BOOK: Beginning ASP.NET 4 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211 |
Welcome to the p2p.wrox.com Forums.
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

March 20th, 2012, 03:18 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
|
|
Chapter 8 - p.271
Hi Imar,
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?
Thanks.
Tulsi
|
|

March 20th, 2012, 03:26 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
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.
Hope this answers the question.
Cheers,
Imar
|
|

March 21st, 2012, 03:46 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
|
|
Thank you.
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?
Tulsi
|
|

March 21st, 2012, 04:09 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
(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....
Cheers,
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

March 22nd, 2012, 12:41 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
|
|
Thank you.
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?
Tulsi
|
|

March 23rd, 2012, 03:29 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
It depends on how well you master them, I guess.
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...
Imar
|
|

March 26th, 2012, 03:59 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
|
|
Thank you. This info was very helpful.
Tulsi
|
|
 |
|