日期:2014-05-17  浏览次数:20519 次

关于传值判断的问题
现在我有2个页面哦
A页面是这样


B页面是这个样的


现在我基本流程是,A页面点击浏览的时候,取得ID然后传值到B页面,B页面在根据ID来读取信息,绑定到控件上面
如果我点击发表意见,那么就只赋值给控件当前的时间和IP

下面是我B页面的代码

  if (!IsPostBack)
 {
 if (Request.QueryString["ID"] != "")
         {
            OpinionFeedBackBLL b = new OpinionFeedBackBLL();
            tb_OpinionFeedBackTable w = new tb_OpinionFeedBackTable();
            w = b.getOpinionFeedBack(Convert.ToInt32(Request.QueryString["ID"]));

            txtopinionfeedback.ReadOnly = true;
            txtname.ReadOnly = true;
            this.txtopinionfeedback.Text = w.OpinionFeedBack;
            this.txtname.Text = w.Name;
            this.lblOpinionFeedBackTime.Text = Convert.ToString(w.OpinionFeedBackTime);
            this.lblIP.Text = w.IP;
           }
            else
             {
            this.btnadd.Visible = true;
            this.lblOpinionFeedBackTime.Text = Convert.ToString(DateTime.Now);
            this.lblIP.Text = Common.GetIPAddress();

            }
}
现在的问题是不知道为什么,我无论是点击浏览,还是点击按钮,都会进入(Request.QueryString["ID"] != "")这个判断里面,我按钮事件里面就写了一个跳转,其他都没写,为什么还会进入到这里面哦

------解决方案--------------------