질문하기질문하기
 

답변됨Retain Chart On PostBack

  • 2009년 7월 2일 목요일 오전 9:36Ohil 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음
    This question may be a fairly common one, but I don't seem to be able to find a solution.

    I have a simple chart that I am populating in code based on the user who is viewing the website. My problem is that the Chart becomes blank after a post-back on the page. Assuming that I was initializing some data in the asp code, I shifted all my initializations (visual appearance etc) to C# code.

    My aspx page contains just
    <asp:Chart ID="ChartUserPoints" runat="server" Height="247px" Width="382px" style="margin-right: 0px"></asp:Chart>
    

    I have ViewState set to Default. But on each postback, my viewstate data is null. I am using temp file configuration in web.config with timeout = 20 (if that matters)

    Could someone please help me solve this problem?

    • 편집됨Ohil 2009년 7월 2일 목요일 오전 9:41
    • 편집됨Ohil 2009년 7월 2일 목요일 오전 9:38
    • 편집됨Ohil 2009년 7월 2일 목요일 오전 9:38added code, spelling error :P
    •  

답변

  • 2009년 7월 7일 화요일 오후 4:53DelianTMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨코드 있음
    Enable view state in the aspx page - EnableViewState have to be set before page load stage:

    <asp:Chart ID="ChartUserPoints" runat="server" Height="247px" Width="382px" style="margin-right: 0px" EnableViewState="True"></asp:Chart>


    • 답변으로 표시됨Ohil 2009년 7월 13일 월요일 오전 5:37
    • 답변으로 제안됨DelianTMSFT, 중재자2009년 7월 7일 화요일 오후 4:57
    •  

모든 응답

  • 2009년 7월 7일 화요일 오후 4:53DelianTMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨코드 있음
    Enable view state in the aspx page - EnableViewState have to be set before page load stage:

    <asp:Chart ID="ChartUserPoints" runat="server" Height="247px" Width="382px" style="margin-right: 0px" EnableViewState="True"></asp:Chart>


    • 답변으로 표시됨Ohil 2009년 7월 13일 월요일 오전 5:37
    • 답변으로 제안됨DelianTMSFT, 중재자2009년 7월 7일 화요일 오후 4:57
    •