簡體   English   中英

如何在其他選項卡發生回發后保留選項卡內容

[英]how to retain the tab content after postback occured by other tab

我在tab1顯示了六個谷歌圖表,在tab2中顯示了一個列表框和幾個gridviews。 當第一次呈現頁面時沒有問題,但是當listbox tab2 selectionindexchanged發生回發時,所有圖表內容都會丟失並顯示異常Unable to get property 'length' of undefined or null reference在Tab1中Unable to get property 'length' of undefined or null reference 我怎樣才能克服這種情況?

<div id="contentArea">
    <ul>
        <li><a href="#tab-1">Incidents Summary</a>
        </li>
        <li><a href="#tab-2">Pending Incidents Summary</a>
        </li>
        <li><a href="#tab-3">SLA Analysis</a>
        </li>
    </ul>
    <div id="tab-1">
        <table id="table_Incident_Summary" style="width:100%;" align="center">
            <tr>
                <td>Incidents Logged - Last 6 months</td>
                <td>Incidents Logged - CategoryWise</td>
                <td>Incidents Logged - Severitywise</td>
            </tr>
            <tr>
                <td id="chart1" height="200" width="400"></td>
                <td id="chart2" height="200" width="400"></td>
                <td id="chart3" height="200" width="400"></td>
            </tr>
            <tr>
                <td>Incidents Reopened - Last 6 months</td>
                <td>SLA - Last 6 months</td>
                <td>Average closing time - Last 6 months</td>
            </tr>
            <tr>
                <td id="chart4" height="200" width="400"></td>
                <td id="chart5" height="200" width="400"></td>
                <td id="chart6" height="200" width="400"></td>
            </tr>
        </table>
    </div>
    <div ID="tab-2"></div>
</div>

對於要在回發后更改的那些控件使用Update-panels,並將“click”事件作為其觸發器。 不要忘記將Update-panels的更新模式設置為“Conditional”。

如果要在Button1上單擊刷新Gridview1,則將Gridview1放在更新面板中,並使用Button1.Click()事件作為觸發器。

您還可以將您的圖表放在更新面板中,並使它們成為有條件的,這樣它們就不會刷新。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM