Access ASCX controls from the Code Behind file?

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
 
F

Frits van Soldt

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)
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top