using a usercontrol from code behind

Discussion in 'ASP .Net Building Controls' started by John Koswalski, Dec 4, 2003.

  1. I have a test usercontrol,

    It works fine from the HTML page of the webform. If i want to manipulate
    the control (properties, methods) I can get that to work if add in
    dynamically at run time. Adding it to the webform at design time (drag and
    drop) doesn't allow me access to the properties and methods from the code
    behind. I added the declaration to the control without the new keyword and
    I even tried to direct cast the control using the FindControl function to
    the variable but it doesn't work ... any ideas .....

    Thx
     
    John Koswalski, Dec 4, 2003
    #1
    1. Advertising

  2. John Koswalski

    William Guest

    "John Koswalski" <> wrote in message news:<#>...
    > I have a test usercontrol,
    >
    > It works fine from the HTML page of the webform. If i want to manipulate
    > the control (properties, methods) I can get that to work if add in
    > dynamically at run time. Adding it to the webform at design time (drag and
    > drop) doesn't allow me access to the properties and methods from the code
    > behind. I added the declaration to the control without the new keyword and
    > I even tried to direct cast the control using the FindControl function to
    > the variable but it doesn't work ... any ideas .....
    >
    > Thx



    When you declare the control in your codebehind page it has to have
    the same name as the ID of the user control in the aspx page.
     
    William, Dec 4, 2003
    #2
    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:
    607
    Alphonse Giambrone
    Jun 28, 2003
  2. Michael Evanchik
    Replies:
    1
    Views:
    427
    Michael Evanchik
    Jul 30, 2003
  3. Shiva
    Replies:
    1
    Views:
    2,697
    Shiva
    Sep 2, 2004
  4. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    499
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  5. Reik
    Replies:
    1
    Views:
    248
    Brock Allen
    Apr 12, 2005
Loading...

Share This Page