User Control Variable not getting generated

G

Guest

Hi,

I am having a trivial problem which is not that important but I would
like to know if I am missing something. I have created a user control. When I
drag the user control into one of the web forms, it should generate the
variable in the code -behind like Protected WithEvents uc1 as UserControl1.
But it is not generating that. So Everytime I drag the user control onto one
of the forms I need to manually add that variable. Am I missing something to
generate that code? Please let me know.

Thanks,
Sridhar.
 
G

Guest

Web user controls won't generate that markup when you add them to the page.
You don't need the protected ... stuff for the user control to work. you do
need that, however, if you want to access data from that control using
asp.net.

HTH,
Darren Kopp
http://blog.secudocs.com/
 
G

Guest

Well, I need to access some properties for that control. That is why I am
looking for that control variable in the Web Designer Generated Code. Every
time I need to add them manually which is not the right way of doing.

Thanks,
Sridhar.
 
G

Guest

Yeah, in that case it probably will be annoying. Basically, it doesn't need
to create that code markup because a user control isn't a class variable.
When asp.net is rendering the page, it see's the user control's tag, it
renders the user control and just puts the html in the page.

-Darren Kopp
http://blog.secudocs.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top