Set Page properties in custom control

Discussion in 'ASP .Net Building Controls' started by NKaufman, Jul 22, 2008.

  1. NKaufman

    NKaufman Guest

    I have a custom control that creates some labels, textboxes and
    buttons. In the PreRender() I am trying to set up something similar
    to
    the following;

    form.defaultbutton = Button1
    form.defaultfocus = TextBox1


    It does not work. Any pointers would be appreciated.


    Thanks
    NKaufman, Jul 22, 2008
    #1
    1. Advertising

  2. Hi NKaufman

    >I have a custom control that creates some labels, textboxes and
    > buttons. In the PreRender() I am trying to set up something similar
    > to
    > the following;
    >
    > form.defaultbutton = Button1
    > form.defaultfocus = TextBox1
    >
    >
    > It does not work. Any pointers would be appreciated.

    Use the PreRender Event in the CustomControl.

    protected overrides OnPreRender(object sender, EventArgs e) {
    this.Page.Form.<XXXX> = <XX>;
    }

    --
    Gruss, Peter Bucher
    Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
    http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
    http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
    Peter Bucher [MVP], Aug 20, 2008
    #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. Nathan Sokalski
    Replies:
    0
    Views:
    903
    Nathan Sokalski
    Oct 17, 2005
  2. Mad Scientist Jr

    asp.net page not seeing custom control, can't set properties

    Mad Scientist Jr, Feb 17, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    199
    Mad Scientist Jr
    Feb 17, 2004
  3. Nathan Sokalski
    Replies:
    0
    Views:
    204
    Nathan Sokalski
    Oct 17, 2005
  4. Mad Scientist Jr

    asp.net page not seeing custom control, can't set properties

    Mad Scientist Jr, Feb 17, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    201
    Alessandro Zifiglio
    Feb 19, 2004
  5. Nathan Sokalski
    Replies:
    0
    Views:
    233
    Nathan Sokalski
    Oct 17, 2005
Loading...

Share This Page