Wrox Programmer Forums
|
BOOK: Professional ASP.NET 1.0, Special Edition/1.1
This is the forum to discuss the Wrox book Professional ASP.NET 1.1 by Alex Homer, Dave Sussman, Rob Howard, Brian Francis, Karli Watson, Richard Anderson; ISBN: 9780764558900
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 1.0, Special Edition/1.1 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 November 4th, 2005, 05:48 PM
Authorized User
 
Join Date: Nov 2005
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
Default ASP.NET 1.1-Add UserControl at Runtime

In DS.ascx, I have 40 input controls like textboxes, dropdownlist, checkbox, etc. and save buttons etc....

I used this DS.ascx in another control (by dragging and dropping into) "UseDSControl.ascx" by using the following code:

UseDSControl.ascx.vb: g_ctlDS = LoadControl("ctlDS.ascx")

and then when I try to set the control default value (or) accessing values for textbox, it says txtname/chkallow not available. Because it's protected in ctlDS.ascx, I changed it to "public withevents txtname as textbox" but it automatically changes back.

see the following: how to do this in ctlUseDSControl.ascx.vb without writing public properities for each control to set/get values in ctlDS.ascx:

ctlUseDSControl.ascx.vb:

if g_ctlDS.chkAllow then
    'call function 1
else
    'call function 2
end if

g_ctllDS.txtName="ABC"

Please let me know ASAP.


Thanks for your help in advance.
 
Old November 4th, 2005, 07:04 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Cross post of http://p2p.wrox.com/topic.asp?TOPIC_ID=36335. Please see there for answer.

Can you please not cross-post? Also, picking a right forum for your question (e.g. not a book specific one, or general VB.NET but an ASP.NET forum) generally helps in getting a better answer.
Also, ASAP may not be the best way to trigger people to give you a quick answer.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Poveri Fiori (Cilea) by Maria Callas (Track 6 from the album: Maria Callas: The Voice Within the Heart) What's This?
 
Old April 8th, 2006, 02:57 AM
Authorized User
 
Join Date: Apr 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Great!

Cheers,

guoyi






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add usercontrol in tooltip KamalRaturi ASP.NET 2.0 Professional 0 October 25th, 2007 09:07 AM
how to get the control in runtime in asp.net page Somesh ASP.NET 2.0 Professional 6 March 7th, 2007 11:33 PM
Add asp.net page to asp project debdemoe Classic ASP Basics 0 August 17th, 2005 12:28 PM
Event in an ASP.NET 2 usercontrol bmains ASP.NET 2.0 Basics 1 February 25th, 2005 03:28 PM
how to add more than one form in asp.net alyeng2000 ASP.NET 1.0 and 1.1 Professional 2 July 19th, 2004 02:58 PM





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