Connecting Web Part Controls...

Discussion in 'ASP .Net Web Controls' started by Steven, Jul 19, 2006.

  1. Steven

    Steven Guest

    Hello All,

    I have a program that implements two custom web parts, one as a
    provider webpart and another as a consumer webpart.

    The provider webpart contains a gridview control. When a row is
    selected it then populates the consumer webparts textbox with
    description data. The consumer webpart contains a text box for editing
    the data (DescriptionContentText) and a button to update the
    description received from the provider web part
    (UpdateDescriptionContent). The event handle for the button click event
    is connected in the consumer webparts CreateChildControl() method.

    The problem is that this event is firing before the connection between
    the two webparts has been created. Therefore when the event handler is
    called, it checks if the provider (descriptionProvider) has been
    created, always finds it set to null, and therefore never updates the
    description field in the gridView (in the Web Part Provider)

    Event Handler:
    void UpdateDescriptionContent_Click(object sender, EventArgs e)
    {
    if (descriptionProvider != null)
    {
    descriptionProvider.Description =
    DescriptionContentText.Text;
    }
    }

    When I debug the program the methods to connect the web parts is always
    called right after the button click event fires and before the
    PreRender event is called. How then is it possible to cause the button
    click to update the providers data?

    Cheers for any help.
    Steven, Jul 19, 2006
    #1
    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. Joerg Jooss

    Re: Web part versus Custom controls

    Joerg Jooss, Feb 26, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,880
    Joerg Jooss
    Feb 26, 2006
  2. Nathan Sokalski
    Replies:
    5
    Views:
    985
    Gaurav Vaish \(www.Edujini-Labs.com\)
    Jan 10, 2007
  3. Nathan Sokalski
    Replies:
    4
    Views:
    266
    Nathan Sokalski
    Dec 21, 2006
  4. Nathan Sokalski
    Replies:
    4
    Views:
    304
    Nathan Sokalski
    Dec 21, 2006
  5. Jack
    Replies:
    8
    Views:
    263
Loading...

Share This Page