Results 1 to 4 of 4

Thread: AutoPostback for the Textbox in the userControl

  1. #1

    Thread Starter
    Fanatic Member vuyiswamb's Avatar
    Join Date
    Jan 2007
    Location
    South Africa
    Posts
    830

    AutoPostback for the Textbox in the userControl

    Good Day All

    I have a textbox in a userControl and it has a Property "Autopostback" set to true, and as i know , this is encapsulated from the hosting page. now i need to set this property to true so that the Gridview in the Hosting page can recognize that the textbox of the usercontrol is set to true. I have added the following Properties from my User Control


    Code:
        public bool TextBoxAutoPostBack
        {
            get {
                return txtbxActvs.AutoPostBack;
                }
              set
              {
                  txtbxActvs.AutoPostBack = value;
             
              }
        }
    Now i need to use them in my hosting page.

    Thanks

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: AutoPostback for the Textbox in the userControl

    Hey,

    So what is stopping you accessing the property of your user control?

    Do you have a reference to the control? If so, you should be able to simply go .TextBoxAutoPostBack and set the value to what you want.

    Gary

  3. #3

    Thread Starter
    Fanatic Member vuyiswamb's Avatar
    Join Date
    Jan 2007
    Location
    South Africa
    Posts
    830

    Re: AutoPostback for the Textbox in the userControl

    How do i use Autopostback Property that i got from a textbox in the usercontrol in the host page.

    That is a Question

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: AutoPostback for the Textbox in the userControl

    Hey,

    If I have understood you correctly, you have a user control, let's say called MyUserControl, and you have an instance of it called myUserControl1. In addition you have a property on that user control called TextBoxAutoPostBack.

    So, from your hosting page, i.e. the page that contains the user control, you should be able to do the following:

    Code:
    myUserControl1. TextBoxAutoPostBack = true;
    Is that not what you are asking?

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width