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

asp.net使用ajax后如何在客户端弹出提示对话框

//平常调用javascript方法
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert'Weclome!!!');</script>");
背景不为白色的方法:
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('添加失败,请联系技术员!');</script>");
//加入ajax后调用javascript方法
ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "", "alert('Weclome!!!');", true);
第一个参数是触发此提示框空间的ID,第二个参数类型,第三个参数是脚本名字(可以为空),第四个参数javascript代码,记住在次无需再用script标签,第五个参数是否启用.
例子:
bool b= tmaintainmanager.PMaintainUpdate(tmaintain);
            if (b)
            {
                ScriptManager.RegisterClientScriptBlock(btnsave, this.GetType(), "", "alert('提交成功!');",true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(btnsave, this.GetType(), "", "alert('提交失败,请联系管理员!');", true);
            }


相关文档:

asp.net结合html,javascript实现无刷新跨域数据提交

需求:
A域有页面a.html,其中有iframe包含B域的页面b.html,现在要通过a.html上的一个按钮,来把a.html页面上一个文本框的值传递到b.html页面的文本框。
注:这里b.html是html网页,不能接收其他网站post过来的值,所以不能用直接post的方法来传值,但是,如果接收页面是b.aspx或者b.asp 呢,那不是可以直接post了么?答 ......

Javascript 在ASP.net 母板页下访问 控件ID:

Javascript 在ASP.net 母板页下访问 控件ID:
对于 html control : 直接访问ID
document.getElementById("hfRespondID");
对于 Web control :
document.getElementById("<%= this.hfRespondID.ClientID %>") [注意大小写
]     
     &nb ......

asp.net 导出Excel

public bool SaveExcel(GridView paramGridView)
{
if (paramGridView.Rows.Count == 0)
{
return false;
}
//创建Excel对象
Microsoft.Office.Interop.Excel.Application myExcel = new Microsoft.Office.Interop.Excel.Appl ......

asp.net 发送邮件

web.config
    <system.net>
        <mailSettings>
            <smtp deliveryMethod="Network" from="mymail&lt;you@163.com&gt;">
       ......

Asp.net 页面传值之 @ PreviousPageType 指令。

给出如下例子 我只知道这样做可以调用上一个页面 的值或者方法 但是我不知道原理和它的优略
请高手 加以指点 大家共同学习 谢谢!
1.Default.aspx 页面
protected void but1_Click(object sender, EventArgs e)
    {
        Server.Transfer("Default2.aspx"); ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号