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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UserControl Issue

Status
Not open for further replies.

nikhilparchure

Programmer
Oct 6, 2001
121
AU
Hi Guys ,
Have made UserControl for some common functionality.
This usercontrol exposes some properties that needs to be assinedat runtime.
I have some problem doing this.

I have been able to achevive this using the below code
----------------------------------------
Dim TestControl As Control
TestControl = LoadControl("TestUserControl.ascx")
((TestUserControl)TestControl).ClientPage = this


But I want to use the drag-drop facility of UserControl
such that

I have the folowing declaration in the container aspx page
<%@ Register TagPrefix=&quot;TestUserControl&quot; TagName=&quot;TestControl&quot; Src=&quot;../CustomControls/TestUserControl.ascx&quot; %>


and I include the entry in the <body> as

<TestUserControl:TestControl id=&quot;TestPage&quot; runat=&quot;server&quot;></TestUserControl:TestControl>

now I would like to assign the ClientPage property of my TestUserControl using the codebehind , but I am not able to get this in CodeBehind nor in inline code, how would I achieve that.

*******************************************************
To be short , I would like to have the reference of the container.aspx page passed on to the usercontrol at runtime.
******************************************************

I might be missing some stuff , pls guys help me.

Regards
Parchure Nikhil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top