why cannot find the control of another updatepanel? pls help me

Last post 08-08-2007 5:20 AM by Jin-Yu Yin - MSFT. 5 replies.

Sort Posts:

  • why cannot find the control of another updatepanel? pls help me

    08-02-2007, 3:26 AM
    • Loading...
    • doris
    • Joined on 08-02-2007, 3:02 AM
    • Posts 2

    Dear all could you do me a favor?Smile

    I faced a problem abt ajax updatepanel. I have a master page with 2 UserControls, each UserControl has a updatePanel., U1 contains a treeview, U2 contains a label. I assign a trigger event to U2

     "<Triggers>
            <asp:AsyncPostBackTrigger ControlID="treeview" EventName="SelectedNodeChanged" />
     </Triggers>"

     i wanna the label to display the selected node name, when i run it, the error is "cannot find the 'treeview' control in this updatepanel",  How tol solve it pls?

     Thanks a lot!Yes

  • Re: why cannot find the control of another updatepanel? pls help me

    08-02-2007, 3:48 AM

    I think you have to use the name of the control as it appears on the rendered web page on the client. So open the web page in IE (you will have to remove the trigger first to avoid the error) and then do a "View....Source". Search for "treeview" and you will see the full name of the control something like "ctl00$ContentPlaceHolder1$TreevView" etc. Use this as the controlID of the control in your trigger.

  • Re: why cannot find the control of another updatepanel? pls help me

    08-02-2007, 3:50 AM
    • Loading...
    • MatsL
    • Joined on 01-31-2007, 8:22 AM
    • Sweden
    • Posts 257

    ---- Edit ---- 

    Oops, was thinking of something completetly different...


     

  • Re: why cannot find the control of another updatepanel? pls help me

    08-02-2007, 6:15 AM
    • Loading...
    • doris
    • Joined on 08-02-2007, 3:02 AM
    • Posts 2

    thank you niallhannon

    It means Ajax updatepanel supports treeview control, right?

     When i cleck on treeview node, i wanna refresh the page except treeview part, so i put all controls inside different updatepanels, If i dont put treeview inside updatepanel, the treeview refresh as well, and all nodes collapses again.

    any googd suggestion?Smile

  • Re: why cannot find the control of another updatepanel? pls help me

    08-02-2007, 7:23 AM
    • Loading...
    • MatsL
    • Joined on 01-31-2007, 8:22 AM
    • Sweden
    • Posts 257

     Actually TreeView inside UpdatePanel isn't a supported scenario, but I see people using it so I guess it should work...

    Make sure that you set UpdateMode of the updatepanels to conditional, atleast the one with the treeview in it.
    You should also probably set ChildrenAsTriggers to false on the updatepanel with the treeview.

  • Re: why cannot find the control of another updatepanel? pls help me

    08-08-2007, 5:20 AM
    Answer

    Hi doris,

    Thank you for your post!

    I think the main issue is that the treeview is in another UserControl, so the question is "How to Trigger PostBack to an UpdatePanel from a separate UserControl?  ", This link mentioned a workground for it.

    Certainly,the findcontorl method can do it.

    But I think the best solution is to Bubble the SelectedNodeChanged Event of the treeview to a custom event of UserControl.then specify the custom event as a Trigger for the update panel.

    See these links:

    1. Can I specify a UserControl custom event as a Trigger for update panel on Parent page?

    Ok,Hope these help you!

    Best Regards

    Sincerely,
    Jin-Yu Yin
    Microsoft Online Community Support
Page 1 of 1 (6 items)