AsyncPostBack from within a CompositeControl

Last post 12-11-2006 8:56 AM by molmorg. 2 replies.

Sort Posts:

  • AsyncPostBack from within a CompositeControl

    12-05-2006, 11:27 AM
    • Member
      75 point Member
    • molmorg
    • Member since 08-07-2002, 4:32 AM
    • Posts 15

    Our project has inherited some composite controls that we can't change. One of these composite controls contains a dropdownlist that we'd like to trigger an asyncpostback that fires an update panel.

     We can make the dropdownlist AutoPostBack but we can't make it work asynchronously. I've tried a number of things including using the unique client ID without success:

    e.g.

    	<triggers>
    		<ajax:AsyncPostBackTrigger ControlID="compositeControl$ctl01" EventName="OnSelectedIndexChanged"></ajax:AsyncPostBackTrigger>
    	</triggers>
    </ajax:UpdatePanel>
     Any ideas?

     

  • Re: AsyncPostBack from within a CompositeControl

    12-11-2006, 1:52 AM
    Answer
    Try to change your codes as the following.It should work fine.
    <triggers>
    <ajax:AsyncPostBackTrigger ControlID="compositeControlID" EventName="SelectedIndexChanged"></ajax:AsyncPostBackTrigger>
    </triggers>
    </ajax:UpdatePanel>
    If you still have any problem,I suggest you to download the latest Ajax Beta 2 and Futures November CTP to install in your PC.
    Wish the above can give you some helps.

  • Re: AsyncPostBack from within a CompositeControl

    12-11-2006, 8:56 AM
    • Member
      75 point Member
    • molmorg
    • Member since 08-07-2002, 4:32 AM
    • Posts 15

    Thanks Jasson,

    That wouldn't work because nothing is posted back with the compositeControlID - it wouldn't get picked up against the list of _asyncPostBackControlIDs. Finding this out led to the solution though:

     My subcontrol didn't have an ID set explicitly...

     _listBox.Id = "someId";

     Now this works:

    <triggers>
    <ajax:AsyncPostBackTrigger ControlID="compositeControlID$someId" EventName="SelectedIndexChanged"></ajax:AsyncPostBackTrigger>
    </triggers>
    </ajax:UpdatePanel>

Page 1 of 1 (3 items)