Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Server Control and Component Development by Dr. Shahram Khosravi; ISBN: 9780471793502
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 27th, 2008, 04:37 AM
Authorized User
 
Join Date: Oct 2006
Location: Jakarta, , Indonesia.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Nicholsen
Default Page 104

You must initialize your child controls before you add them to the Controls collection of your custom
control, because if you initialize them after you add them to the Controls collection, these initialized
property values will be saved to view state. This will unnecessarily increase the size of your custom control’s
view state.
I need more detail explanation about the difference between :
paymentMethodList = new DropDownList();
paymentMethodList.Width = Unit.Percentage(100);
paymentMethodList.Items.Add(new ListItem(“Visa”, “Visa”));
paymentMethodList.Items.Add(new ListItem(“MasterCard”, “MasterCard”));
paymentMethodList.ID = “PaymentMethodList”;
container.Controls.Add(paymentMethodList);

with

DropDownList paymentMethodList;
container.Controls.Add(paymentMethodList);
paymentMethodList = new DropDownList();
paymentMethodList.Width = Unit.Percentage(100);
paymentMethodList.Items.Add(new ListItem(“Visa”, “Visa”));
paymentMethodList.Items.Add(new ListItem(“MasterCard”, “MasterCard”));
paymentMethodList.ID = “PaymentMethodList”;

Can Everybody explain more detail about why before initialization and after initialization can affect ViewState size!

Thank You Very Much

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
access C#.Net page as action of calssic ASP page mansharma_s ASP.NET 1.x and 2.0 Application Design 6 January 7th, 2008 09:58 AM
confuse page 104 kencheung BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 August 16th, 2004 03:32 PM



All times are GMT -4. The time now is 08:38 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.