질문하기질문하기
 

답변됨Chart empty when using Updatepanel

  • 2009년 7월 1일 수요일 오후 4:11srajgopal 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    I have 3 parts in a webpage.

    1. Search - clicking a button is supposed to trigger the update panel on 3 and render the chart.
    2. Hidden Grid - in an updatepanel1 refreshed on the chart click from 3.
    3. Chart - in an updatepanel2

    When I click search, the chart displays without flicker. When the chart is clicked, the grid in 2 gets refreshed but the chart is empty.

    I tried setting the Viewstate on the chart to true. Any suggestions?
    •  

답변

  • 2009년 8월 17일 월요일 오후 4:13srajgopal 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    Things started working fine when I added the attribute

    <asp:Chart EnableViewState="true"

    Previously, I was doing this in the code behind and must have missed something.

모든 응답

  • 2009년 8월 13일 목요일 오후 10:21DelianTMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     제안된 답변
    If chart click triggers updatepanel1, this should not happen - chart should not be updated. Please check "Interactivity and AJX\AJAX\Chart as Trigger" chart web sample.
    Delian
  • 2009년 8월 17일 월요일 오후 3:16srajgopal 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    I believe it looks as you mentioned but still not sure why it would render the chart empty when the second updatepanel is brought into the picture.

     <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>Gridview Here</ContentTemplate>
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="Chart1" EventName="Click" />
    </Triggers>
    </asp:UpdatePanel>


    <asp:UpdatePanel ID="UpdatePanel2" runat="server" >
    <ContentTemplate>Chart Here</ContentTemplate>
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
    </Triggers>
    </asp:UpdatePanel>

  • 2009년 8월 17일 월요일 오후 4:13srajgopal 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    Things started working fine when I added the attribute

    <asp:Chart EnableViewState="true"

    Previously, I was doing this in the code behind and must have missed something.