Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X
This is the forum to discuss the Wrox book Professional Web Parts and Custom Controls with ASP.NET 2.0 by Peter Vogel; ISBN: 9780764578601
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X 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 May 1st, 2006, 03:24 PM
Registered User
Join Date: May 2006
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default multiple constructors for custom controls

Hi! Thank you for reading.

Congratulations for your superb book!

I am just starting with Custom Web Controls. I tried to find how to have multiple constructors for custom controls, but I can't find it on the book...

I developed 2 constructors for my first custom control.
The problem is that ONLY the "default"/no arguments constructor gets called.
I think this happens because I do NOT know how to build my control, the right way, in the ASPX:

For example, when I want to pass arguments p1 and p2, I write what follows in the ASPX and it works, as far as passing the values to public properties named p1 and p2, but won’t call a two parameter constructor.

<prefix:class p1="1" p2="2"></prefix:class>

So, my questions are:
#1) can I have multiple constructors with custom web controls?
#2) if yes, then what should I write in the ASPX, to call a specific constructor?

Thank you so much, for your time and teachings!

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
Custom Control with Multiple Constructors? three ASP.NET 2.0 Basics 12 May 2nd, 2006 05:29 PM
Custom Controls apry BOOK: Beginning ASP.NET 1.0 2 May 23rd, 2004 11:04 PM
Multiple Constructors Page 194 NUTSHELL BOOK: Beginning Java 2 2 February 5th, 2004 11:00 PM
Custom Controls bmains VS.NET 2002/2003 3 February 5th, 2004 09:54 AM

All times are GMT -4. The time now is 03:41 PM.

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