Postback to a Custom Control URGENT!!

Discussion in 'ASP .Net Building Controls' started by Chris, May 4, 2004.

  1. Chris

    Chris Guest

    Does anyone have any examples of how to handle postback to a derived class
    custom control from the hosting main page or a popup child window from the
    main page?
    And then storing information in a variable declared in the control?

    Any help would be greatly apprectiated!
    Thanks in advance.
     
    Chris, May 4, 2004
    #1
    1. Advertisements

  2. Chris

    ccallen Guest

    Quickstart/aspplus/samples/webforms/ctrlauth/composition/cs/composition3.cs
    (from the .net sdk) has two events (AddBtn_Click & SubtractBtn_Click) that
    changes a value stored in a text box.

    The storage method could be modified to use a member variable (or viewstate
    (not shown)):

    protected string _value;

    public string Value {
    get { return _value; }
    set { _value = value.ToString(); }
    }

    composition then fires the Change event in the parent page. The parent can
    access the controls public properties, Value in this case.

    ccallen
     
    ccallen, May 4, 2004
    #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.