Tag Archives: postback

ASTreeView – Perform PostBack while deleting nodes

How to do a postback after a node being deleted? Here’s the steps: 1. Set the OnNodeDeletedScript property of ASTreeView. OnNodeDeletedScript=”deletedHandler(val)” 2. Add a hidden button and a textbox(both are server side control) to the page: <div style=”display:none;”> <asp:Button ID=”btnPostBackTrigger” runat=”server” OnClick=”btnPostBackTrigger_Click” /> <asp:TextBox ID=”txtIDContainer” runat=”server”></asp:TextBox> </div> 3. Implement the deletedHandler javascript method: <script type=”text/javascript”>… Read More »

ASTreeView – How to disable checkbox PostBack

There’s a request that to disable the checkbox PostBack while the AutoPostBack properties is set to true. Because for node selection, we want to enable the PostBack. By default, if we set the AutoPostBack properties of ASTreeView, both the checkbox and selection will be effected. So here we need a little tricky to achieve that:… Read More »

用JavaScript执行PostBack

早上实现了在子页面更新数据以后,父页面刷新树的功能 思路: 父页面有个隐藏的html button作为proxy,子页面保存完数据以后,用js调用父页面的html button的触发函数click(); 父页面有个asp.net的link button控件,text="",等于也是隐藏的,它负责调用后台cs代码里的负责刷新树的方法; 父页面的html button onclick的时候,__doPostBack(‘DoRefresh’,”); 代码: 父页面apsx: <input type=”button” id=”DoRefreshProxy” value=”DO” onclick=”__doPostBack(‘DoRefresh’,”);” style=”display:none;” /> <asp:linkbutton id=”DoRefresh” runat=”server” onclick=”DoRefresh_Click” CausesValidation=False/> 父页面cs: protected void DoRefresh_Click(object sender, EventArgs e) { this.BindTree(this.tvBuilding.SelectedNodeIndex,1); } 子页面cs: Page.RegisterStartupScript(“pb”,”<script> window.opener.document.getElementById( ‘DoRefreshProxy’ ).click();</script>”);