在asp.net中显示消息框 [英] display messagebox in asp.net

查看:130
本文介绍了在asp.net中显示消息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关显示在sucessfull消息框保存的任何项目我想显示消息框。

For displaying message box on sucessfull save of any item i wanted to show messagebox.

我GOOGLE了它,并尝试不同的codeS,但没有一次成功。

I googled it and tried different codes but none of them worked.

目前我code为:

 try
 {
     con.Open();
     string pass="abc";
     cmd = new SqlCommand("insert into register values('" + txtName.Text + "','" + txtEmail.Text + "','" + txtPhoneNumber.Text + "','" + ddlUserType.SelectedText + "','" + pass + "')", con);
     cmd.ExecuteNonQuery();
     con.Close();
     Response.Write("<script LANGUAGE='JavaScript' >alert('Login Successful')</script>");
}
catch (Exception ex)
{

}
finally
{
    con.Close();
}

它不工作。请我的GUID的消息框code。 我使用Mozilla浏览器。

Its not working. Kindly guid me with the messagebox code. I am using Mozilla browser.

推荐答案

@freelancer如果你正在使用的ScriptManager那就试试这个code消息。

@freelancer If you are using ScriptManager then try this code for message..

string script = "alert(\"Hello!\");";
ScriptManager.RegisterStartupScript(this, GetType(), 
                      "ServerControlScript", script, true);

这篇关于在asp.net中显示消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆