Access ASCX controls from the Code Behind file?

  • Thread starter Thread starter Willy
  • Start date Start date
W

Willy

Hi All!

I'm using Code-behind model for my ASP.NET pages. But to skip the
compilation step, I reference my code-behind pages as follows...

<%@ Page Language="VB" Debug="true" Src="~/code/MyTestPage.vb" %>

It works beautifully. But how do I access the User Controls (non-compiled
ASCX files) those are placed in my MyTestPage.aspx ?

Thank you all in advance!

willy
 
Willy said:
Hi All!

I'm using Code-behind model for my ASP.NET pages. But to skip the
compilation step, I reference my code-behind pages as follows...

<%@ Page Language="VB" Debug="true" Src="~/code/MyTestPage.vb" %>

It works beautifully. But how do I access the User Controls (non-compiled
ASCX files) those are placed in my MyTestPage.aspx ?

Thank you all in advance!

willy
Like this:
Private TabPersonalia As TabPersonaliaUC ' user defined control

and in the page load:

' cast user defined controls to make visible in code behind

TabPersonalia = DirectCast(FindControl("TabPersonalia"), TabPersonaliaUC)
 
Back
Top