User Controls

Discussion in 'ASP .Net Web Controls' started by Scott D, Nov 6, 2003.

  1. Scott D

    Scott D Guest

    I am having problems making the textboxes and other controls
    avaialable to the code-behind page of an ASPX page with multiple user
    controls inserted into it. I believe I need to make the ASCX
    textboxes and controls avaialble publicly but do not know how to
    accomplish this task.

    Thank you.
    Scott D, Nov 6, 2003
    #1
    1. Advertising

  2. Scott D

    Guest Guest

    You need to change the declaration of the objects in
    your .ascx code-behind file to Public.

    Change this:
    Protected WithEvents TextBox1 As
    System.Web.UI.WebControls.TextBox

    To this:
    Public WithEvents TextBox1 As
    System.Web.UI.WebControls.TextBox

    However this is not a very secure way to do it but it
    works. You should really declare Get and Set properties
    in the .ascx to set or retrieve the values
    ex Public Property <property name>
    This will generate a Get And Set function automatically or
    you can declare a function. Either must be set public for
    you to use.
    Guest, Nov 6, 2003
    #2
    1. Advertising

  3. Scott D

    Scott D Guest

    Thank you very much for your help.
    Scott D, Nov 7, 2003
    #3
  4. Scott D

    Jim Guest

    Not a problem, hope it worked for you


    >-----Original Message-----
    >Thank you very much for your help.
    >.
    >
    Jim, Nov 7, 2003
    #4
    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. trinitypete

    HTML Controls and User controls

    trinitypete, Jun 25, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    3,358
    trinitypete
    Jun 26, 2003
  2. Axel Dahmen
    Replies:
    1
    Views:
    473
    Teemu Keiski
    Nov 12, 2003
  3. Nathan Sokalski
    Replies:
    4
    Views:
    1,135
    Muhammad Naveed Yaseen
    Sep 5, 2007
  4. Faizan Ahmed
    Replies:
    1
    Views:
    271
    John Saunders
    Jan 4, 2005
  5. Faizan Ahmed
    Replies:
    1
    Views:
    347
    John Saunders
    Jan 4, 2005
Loading...

Share This Page