易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net在用ajax的时候如何弹出对话框


<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
    <asp:updatepanel ID="UP" runat="server">
      <ContentTemplate>
        <asp:Button runat="server" Text="Button" onclick="Unnamed2_Click" />
      </ContentTemplate>
   </asp:updatepanel>
    </div>
</form>
ASP.NET2.0中AJAX使用新的Manager 类来管理,而不兼容原来的 ClientManager 类 ,所以用response.write("<script>alert('提示:点我了!')</script>")和
this.Client.RegisterClientBlock(this.GetType(), "name", "<>alert('提示:点我了!');</>", true);
Page.Client.RegisterClientBlock(this.GetType(), "name", "<>alert('提示:点我了!);</>", true);
这些方法都是无效的.
可以用以下方法写代码实现
ScriptManager.RegisterStartupScript(UP, UP.GetType(), "", "alert('点我了');", true);
这样就可以实现了!
//UP是updatepanel 的ID
转自http://www.csharp360.com/bbs/viewthread.php?tid=233&extra=


相关文档:

asp.net 服务器端控件中 弹出对话框 操作

HTML代码:
<script language="javascript" event="onclick" for="ImageButton1">
 return confirm('确定要保存变更吗?');//返回false时不执行ImageButton1_Click方法,返回ture时执行ImageButton1_Click方法
</script> 
 <asp:ImageButton ID="ImageButton1" runat="server" ImageAlig ......

Ajax 的状态介绍

在《Pragmatic Ajax A Web 2.0 Primer 》中偶然看到对readyStae状态的介绍,感觉这个介绍很实在,摘译如下:
0: (Uninitialized) the send( ) method has not yet been invoked.
1: (Loading) the send( ) method has been invoked, request in progress.
2: (Loaded) the send( ) method has completed, entire respons ......

Asp.Net中Word,Excel等office com组件操作权限的问题

近日在打开原来写的一个网页程序运行时,出现了Excel操作权限的问题,具体的说就是在代码中调用下面这段与Excel操作有关的语句时,
  Application curExcelApp = new ApplicationClass();
  提示权限不足,具体的提示内容如下:
  检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件时 ......

Asp.Net中验证正规则表达式

using System.Text.RegularExpressions;
Regex reg = new Regex(@"^\d+$"); //验证字符串
        Response.Write( reg.IsMatch(""));
        Response.Write(reg.IsMatch("sf"));
        Response.Write ......

最近的asp.net总结

1. 虽然是.net,但是已经几乎完全放弃了服务器控件,取而代之的是html控件,赋值时候可以通过注册javascript脚本来完成。只是学习途中的一个实践,不知道这样会不会减少编译,增加运行效率。
2. 推荐跟JQuery结合,NND,这丫真的很强大...如果你跟我一样是js小白,又想NB一把弄个AJAX什么的,用JQuery把。。。这孩子包你满 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号