我有2個按鈕(過濾器和視圖摘要)和一個updatepanel。更新面板保存網格。點擊過濾器按鈕時 - 從數據庫中提取數據並觸發更新面板。現在基於數據的內容,我想改變視圖摘要按鈕的可見性。使用jquery更改按鈕的可見性 - UpdatePanel
我曾嘗試 - hfSummaryVis是我在更新面板
function pageLoad() {
alert('<%=hfSummaryVis.Value %>');
}
警報消息始終是空白設置hiddenfield。我也嘗試過document.ready。 Document.Ready僅在頁面首次加載時調用。
請幫
感謝,
<div id="divOrderDateSelector" class="FloatLeft PadDiv" style="padding-top: 3px;">
<asp:Button ID="btnFilter" runat="server" Text="Filter"
OnClick="btnFilter_Click" CssClass="DefaultButton"/>
<asp:Button ID="btnSummary" runat="server" Text="View Summary"
OnClick="btnSummary_Click" CssClass="DefaultButton"
onclientclick="return false"/>
</div>
<br/>
<div id="divbuy" class="ClearBoth PadBottom">
<span class="SectionHeader Block" >Buys</span>
<asp:UpdatePanel ID="upStatus" runat="server" UpdateMode="Conditional" >
<Triggers >
<asp:AsyncPostBackTrigger ControlID="btnFilter" EventName="Click"/>
</Triggers>
<ContentTemplate >
<asp:HiddenField ID="hfSummaryVis" runat="server" />
<asp:GridView ID="gvSummary" runat="server" AutoGenerateColumns="False"
CssClass="ContrastTable WideTable" GridLines="None"
onrowdatabound="gvSummary_RowDataBound">
<EmptyDataTemplate>No Records Found</EmptyDataTemplate>
<RowStyle CssClass="MainTableRow" />
<AlternatingRowStyle CssClass="AlternateRow" />
<HeaderStyle CssClass="HeaderRow" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lkBtnOpen" runat="server" CssClass="Expand ButtonCell PlainLink"
ToolTip="Click to see details of the date's orders."
Text=" " OnClientClick="showCusipAccountDetails(" />
<asp:LinkButton ID="lkBtnClose" runat="server" CssClass="Collapse ButtonCell PlainLink Hidden"
ToolTip="Click to close."
Text=" " />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Strategy Series">
<ItemTemplate>
<asp:Label ID="lblStrategySeries" runat="server" />
</ItemTemplate>
...
讓我們來看看整個javascript – Tim