you want to display a msgbox on the server side? why?

解决方案 »

  1.   

    我写的代码如下:
    SqlDataAdapter myadapter=new SqlDataAdapter("select*from"&dropdownlist.selecteditem.value,myconn);
      DataSet ds=new DataSet();
      myadapter.Fill(ds,"t_Department");
    因为在数据库中可能没有dropdownlist所选择的表,所以执行到myadapter.Fill(ds,"t_Department");时就会出错,我想在出错时在客户端弹出错误提示,我该怎么做?
      

  2.   

    try
    {myadapter.Fill(ds,"t_Department");}
    catch
    {
       Page.RegisterStartupScript("warnings", "<script>alert('提示!');</script>");
    }
      

  3.   

    to  mbm(-- (@ \/ @) --) 
     用这种方法,能不能得到提示框上的按钮事件,比如我想按了"确定"后,调用另一页面
      

  4.   

    我也想知道阿!!
    Page.RegisterStartupScript("warnings", "<script>confirm('提示!');</script>");
    ---判断他有没有确定
      

  5.   

    这样的话我觉得你可以用Page.
    RegisterClientScriptBlock()
    注册一个客户端函数,然后在后台传入参数
    比如
    <script>
    function changeurl(url)
    {
    if(url!=null)
    window.location.href=url;
    }</script>
      

  6.   

    window.location.href=url;我不想到其他页去,此时就执行某个存储过程了??
      

  7.   

    客户端脚本里怎么写MSGBOX?分别响应确定和取消的按钮事件?