Web control in web control


Hi,
There are two simple web user controls A and B, where B contains A. They just display the bunch of text boxes, so I do not need them even in tool pane. They sit in the same project next to web form.
I noticed that web user control put on ASPX page does not appear in code behind, but if I create it with protected keyword and name being exactly the same as id it works fine. I can access such a web control from code behind and see the value assigned in IE. The problem is that the same routine does work for my A web control in B. When I assign the value IE, I keep getting null reference.
I was trying even to move the form tags from the web form to web control, but it did not fix a problem and I guess it is not a write thing to do.
I am pretty sure it is easily doable and there is somebody who did it, fixing this nastly, little problem which I have.
If so, please let me know what the fix is.
0
koszyk
9/1/2006 3:30:34 PM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 6 followers.

💬 2 Replies
👁️‍🗨️ 1724 Views



Hi koszyk,
You would have to put line code:
protected CustomUserControl myCustomUserControl;
In your code-behind. But, you should have care in HTML myCustomUserControl value to ID property <uc1:CustomUserControl>
Good Coding!
Javier Luna
http://guydotnetxmlwebservices.blogspot.com/
 

from Villa El Salvador for world!
0
Javier
9/1/2006 9:43:41 PM

He he...
You bet I have it Big Smile Do you have a similar scenario working on your side (this is 30' job to make it from scratch)?
The most probably I am going to move everything to one web controls and copy-paste my subcontrol's content. Luckily there is not too much "interface-logic" behind, so... I assume live is not perfect and MS stuff as well Wink
Koszyk
0
koszyk
9/4/2006 10:52:29 AM
Reply: