|
Subject:
|
ASP.NET 1.1-Add UserControl at Runtime
|
|
Posted By:
|
rajn
|
Post Date:
|
11/4/2005 4:48:08 PM
|
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.
|
|
Reply By:
|
Imar
|
Reply Date:
|
11/4/2005 6:04:28 PM
|
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?
|
|
Reply By:
|
dutguoyi
|
Reply Date:
|
4/8/2006 2:57:56 AM
|
Great!
Cheers,
guoyi
|
|