Page.RegisterStartupScript("", "<script language='javascript'>window.alert('Message');</script>");Response.Write("<script language='javascript'>window.alert('Message');</script>");

解决方案 »

  1.   

    <script language="c#">
    private void button1_click(object sender,EventArgs e)
    {
        if(textbox1.Text.Trim()=="")
            Response.Write("<script language=javascript>alert('请输入密码')</script>");
    }
    </script>
      

  2.   

    private void Button1_Click(object sender, System.EventArgs e)
    {
    cn = new SqlConnection(ConfigurationSettings.AppSettings["ds"]);
    string strSQL="select * from user_info where user_id="+UserName.Text;
    cm = new SqlCommand(strSQL,cn);
    cn.Open();
    dr = cm.ExecuteReader();
    if(dr.Read())
    {
    if(UserPwd.Text==dr["pwd"].ToString())
    {
    Response.Write("<script>window.alert('密码正确!');</script>");
    }
    else
    {
    Response.Write("<script>window.alert('密码不正确!');</script>");
    }
    }
    else
    {
    Response.Write("<script>window.alert('无此用户!');</script>");
    }
    }
      

  3.   

    private void MessageBox(string msg)
    {
    Response.Write("<Script language=javaScript>");
    Response.Write("alert('"+msg+"')");
    Response.Write("</Script>");
    }
      

  4.   

    楼上的高手你好!
    如何象WINDOWS程序一样可以接收弹出窗口的返回值,如:确定、取消等
      

  5.   

    Response.Write("<script language=javascript>alert('密码错误,请重新输入!');</script>")
      

  6.   

    Page.RegisterStartupScript("check", "<script>alert('成功删除!');</script>")
    Response.Write("<script>alert('你输入的用户名或密码错误!');</script>")
    botton1.Attributes.Add("onclick", "return confirm('您确定要删除');")
    e.Item.Cells[1].Attributes.Add("onclick","javascript:return window.confirm('确定要返回吗?');");
      

  7.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4
      

  8.   

    http://expert.csdn.net/Expert/topic/2914/2914709.xml?temp=1.917666E-02
      

  9.   

    Button2.Attributes.Add("onclick","if("+this.TextBox.ClientID+".value==''){alert('空值');return false;}");
      

  10.   

    e.Item.Cells[1].Attributes.Add("onclick","javascript:return window.confirm('确定要返回吗?');")
    这条语句应该没法把数据网格中的某个按钮和弹出窗口关联起来吧?
    请教如何解决这个问题————如要把数据网格中的删除按钮和弹出窗口关联起来。