Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.NET - UserControl

Status
Not open for further replies.

JustTryingMyBest

Programmer
Jun 8, 2004
4
US
I'm not sure if this is the right forum or not....

I am wondering how I get a reference to my usercontrol that I have added to my form.

I have created a number of properies that I want to use. I added code such as

protected PageHeader1 _PageCtrl, but I do not get the reference to the object which was

created.



Any Ideas?
 
you want to access it from another form in the same project? then make it internal.
 
You will have to translate that for me. I am using visual studio and I created the "user control page" within VS.Net.

When I add that control to my asp.Net form, it generates the "<%@ Register TagPrefix="uc1" TagName="PageHeader1" Src="UserControls/PageHeader1.ascx" %>" tag for the page.

Now how exactly do I get a reference to "PageHeader1"?
 
so you mean you want to access it form the same page...

well, when the control was added to the page, it automatically added it to the form's members. if you'll click on it in the design view you can see it's name property by which you can reference it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top