Access ASCX controls from the Code Behind file?

Discussion in 'ASP .Net Building Controls' started by Willy, Dec 7, 2004.

  1. Willy

    Willy Guest

    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, Dec 7, 2004
    #1
    1. Advertising

  2. Willy

    Willy Guest

    somebody please....

    willy

    "Willy" <> wrote in message
    news:%23BRZZo$...
    > 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, Dec 7, 2004
    #2
    1. Advertising

  3. Willy

    Willy Guest

    help........ :'(

    "Willy" <> wrote in message
    news:...
    > somebody please....
    >
    > willy
    >
    > "Willy" <> wrote in message
    > news:%23BRZZo$...
    >> 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, Dec 7, 2004
    #3
  4. Check these articles out:
    http://www.15seconds.com/issue/020319.htm
    http://www.asp101.com/lessons/usercontrols.asp

    There were top results for google search. They seem to have what you need

    "Willy" wrote:

    > 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
    >
    >
    >
    >
     
    Tampa .NET Koder, Dec 7, 2004
    #4
  5. "Willy" <> wrote in message
    news:#BRZZo$...
    > 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)
     
    Frits van Soldt, Dec 7, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    643
    Alphonse Giambrone
    Jun 28, 2003
  2. Willy
    Replies:
    4
    Views:
    1,859
    Frits van Soldt
    Dec 7, 2004
  3. Sakkatha
    Replies:
    1
    Views:
    511
    Teemu Keiski
    Dec 20, 2005
  4. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    527
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  5. Jack
    Replies:
    1
    Views:
    964
    Alessandro Zifiglio
    Jul 3, 2006
Loading...

Share This Page