Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
246 views
in Technique[技术] by (71.8m points)

javascript - 如何在ASP.NET中显示消息框?(How can I display a messagebox in ASP.NET?)

I want to show a message box on the successful save of any item.

(我想在成功保存任何项目时显示一个消息框。)

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

(我用谷歌搜索并尝试了不同的解决方案,但它们都没有奏效。)

Here is the code I am using:

(这是我正在使用的代码:)

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();
}

(I am using Firefox, if that matters)

((我正在使用Firefox,如果这很重要))

  ask by Freelancer translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...