Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 6th, 2006, 09:37 AM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chp.5 composite control properties

Another question regarding your code doc (or anyone else who's had
success with his code):

I've written public virtual properties for entities such as a label's text, button text, etc; yet I'm unable to change those properties in the VS.NET designer; it ignores changes as if the set{} code of the property doesn't exist. Real simple example:
public virtual string lblHeaderText
        {
            get
            {
                EnsureChildControls();
                return (lblHeader.Text.Length <=0) ? "Please enter the phone numbers to be added to the conversion list:" : lblHeader.Text;
            }
            set
            {
                EnsureChildControls();
                lblHeader.Text = value;
            }
        }

when using the control in design time it ignores changes to this property.

  #2 (permalink)  
Old October 6th, 2006, 03:35 PM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ahh, it looks as exposing TextBoxes and their Text property behaved a bit differently. I ended up creating a private string member of the composite control class and having it return its value/set its value for the property. I also checked the current value of the textbox in the property and set its value to the private string member.

**pardon my code example above, the issue revolved around exposing TextBox.Text values**

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Passing Templates in a Composite Control dparsons ASP.NET 2.0 Professional 0 April 24th, 2008 12:28 PM
Composite Control Part 2 origjones General .NET 2 September 18th, 2006 03:28 AM
Building composite Control with Image + DDL mehdi_tn ASP.NET 2.0 Professional 1 April 12th, 2006 10:48 PM
PLEASE HELP - Composite Control brettk_1 ASP.NET 1.0 and 1.1 Professional 0 August 3rd, 2005 06:22 AM
Composite Control bmains .NET Framework 2.0 0 July 25th, 2005 12:57 PM



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


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