当前位置:编程学习 > C#/ASP.NET >>

怎样点击一个button后,先调用发信的函数,然后在转到另一个页面?

--------------------编程问答-------------------- 你可以做一个判读:

if (result == 1)
            {      
  SendSms(sDst, content)
                 if(发信成功才跳转){
Response.Redirect("three.aspx");

                  }    
                              }  --------------------编程问答-------------------- 贴出

SendSms(sDst, content);


这个方法内容 --------------------编程问答-------------------- SendSms(sDst, content);里面出错了吧。断点跟踪下 --------------------编程问答-------------------- 把发信的函数设置返回值,这样应该就可以了

if (result == 1)
            {            
                if(SendSms(sDst, content))
                    {
                Response.Redirect("three.aspx");
                    }
            }

--------------------编程问答--------------------

bool SendSms(sDst, content)
{
.......
}
if(SendSms(sDst, content))
{
Response.Redirect("three.aspx");
}
--------------------编程问答--------------------
if (result == 1)
            {            
                if(SendSms(sDst, content))
                {
                    Response.Redirect("three.aspx");
                }
            } 
--------------------编程问答-------------------- 晕啊,你执行成功后返回true 判断在跳转啊 --------------------编程问答-------------------- 如何给username带参数? 
string username = reader["username"].ToString();
this.Response.Write("<script>top.location.href='three.aspx?username='; </script>");
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,