Category Archives: asp.net

ASTreeView 1.1.1 Released

The new version of ASTreeView includes: Some bugs fixed: In DropdownTreeView, the RequiredValidator cannot be disabled. Javascript error when ajax request failed. Tree line does not display correctly after move the last node. Initialization of the treeview may cause js error if in the low bandwidth. New features: Add Sever-Side ExpandAll, CollapseAll, ExpandTo(depth) Methods. Add… Read More »

ASTreeView: Resolve confliction with jQuery

Thanks xiaot for reporting this issue that if jQuery is included in page, it conflicts with the ASTreeView. To resolve this issue, we can use the noconflict method of the jQuery: <script src=”jquery-1.3.2.js”></script> <script type=”text/javascript”> var J = jQuery.noConflict(); </script> Now $("#foo") will be J("#foo") and it will not conflict with the ASTreeView. I’ll update… Read More »

ASP.Net按钮提交前执行javascript

here is the code… 在提交前执行一段js <script language=“javascript“> function doSomething() { // 执行自己的javascript // 继续提交 this.click();} </script> <asp:button onmousedown=“doSomething()“ id=“someButton” Text=”提交” runat=”server”> </asp:button>

用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>”);