Wrox Programmer Forums
|
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
 
Old January 7th, 2013, 04:13 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default ch. 15 - Hand Coding Data Acess Code

Imar,

It seems that hand coding is the best option for implementing the Add/Edit page. It does mean more work, but like you said on p.561
Quote:
you do gain a lot of flexibliity and - when done right - you end up with a page that's a lot easier to maintain.
Just curious as to what's more common practice in real world applications...

Is it more common to use ready-made controls and use the AddEditReview.aspx implementation or is it more common to use hand-coding and use the AddEditReviewHandCoded.aspx implementation?


Thank you.
Venu
 
Old January 8th, 2013, 03:59 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I don't have any hard figures, but I think both are common. For complex, professional type of pages I follow the hand coding pattern. For simpler sites, or demo-ware I use the built-in controls.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 8th, 2013, 02:12 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default

Thank you..this makes sense :)

I guess for more complex pages, hand-coding would give you the greater flexibility that u would need, but add some extra work. For smaller sites and prototypes, using the built-in controls will allow you to speed up the development.

But I just want to make sure I understand this correctly...

Hand-coding means using the HTML table for defining the layout with basic asp.net controls such as textbox, dropdown, etc.. and not using the built-in databound/datasource contols such as ListView/sqldatasource? Is this correct?

Thanks.
Tulsi
 
Old January 8th, 2013, 03:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Well, yes and no.

You don't *have* to use a table; it's just very convenient. In most modern web sites you'll see a CSS based layout in favor of tables for layout. For admin pages I don't care that much; that's why I used a table.

In addition, even in a hand coded page you can use the standard datasource and data bound controls. For example, for the Genre drop-down to create a review, you can use a LinqDataSource or any other data source to get the data from the database.

In other words; it's not black and white. You can mix concepts from either into the other.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 8th, 2013, 04:19 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default

Thank you. This was very helpful!

Tulsi
 
Old January 10th, 2013, 02:36 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default

Hi Imar,

Sorry for coming back to this, but just wanted to make sure....

Is the master page (FrontEnd.Master) an example of a CSS based layout?

Thanks,
Tulsi
 
Old January 11th, 2013, 03:45 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, as it uses semantic elements and CSS for the layout; not tables to defined a fixed design....

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Tulsi (January 11th, 2013)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding dropdown list in code behind with hand coding sophia BOOK: Beginning ASP.NET 4 : in C# and VB 1 December 27th, 2011 05:10 PM
Hand Coding VS Data Wizards Bulldog BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 3 May 22nd, 2007 04:21 AM
Ch. 15 Add'l Code? gekkster99999 BOOK: Beginning ASP 3.0 0 February 1st, 2004 10:55 PM
Ch 15 login.asp code sirandre007 BOOK: Beginning ASP 3.0 1 January 3rd, 2004 07:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.