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
    Use the PreRender Event in the CustomControl.

    protected overrides OnPreRender(object sender, EventArgs e) {
    this.Page.Form.<XXXX> = <XX>;
    }
     
    Peter Bucher [MVP], Aug 20, 2008
    #2
    1. Advertisements

Ask a Question

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.