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. Advertisements

  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. Advertisements

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Technical Support
    Replies:
    2
    Views:
    884
  2. Nathan Sokalski
    Replies:
    0
    Views:
    1,239
    Nathan Sokalski
    Oct 17, 2005
  3. Replies:
    0
    Views:
    596
  4. Harlan Messinger
    Replies:
    0
    Views:
    554
    Harlan Messinger
    Feb 18, 2008
  5. 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:
    340
    Mad Scientist Jr
    Feb 17, 2004
  6. Nathan Sokalski
    Replies:
    0
    Views:
    364
    Nathan Sokalski
    Oct 17, 2005
  7. 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:
    365
    Alessandro Zifiglio
    Feb 19, 2004
  8. Nathan Sokalski
    Replies:
    0
    Views:
    397
    Nathan Sokalski
    Oct 17, 2005
Loading...