当代码写在此处就得不到传递过来的值,该怎么办?就是这个Request.QueryString["id"]
当代码写在此处就得不到传递过来的值,该怎么办?就是这个Request.QueryString["id"] public partial class TrainManage_Train_TrainRecord : System.Web.UI.Page{
private string DutySql = "select a.P_ID,a.P_NAME, case a.P_SEX when 0 then '男' when 1 then '女' when 2 then '未知'end as P_SEX ,a.P_DEPARTMENT,c.RP_RESULT,c.RP_PEROSN_ID,c.RP_TRAIN_ID,b.T_ID,b.T_NAME,b.T_START_TIME,b.T_OVER_TIME,d.INFO_ID,d.INFO_NAME from RS_Person a,RS_TRAIN b,RS_TRAIN_PERSON c, RS_D_INFOMATION d where a.P_ID = c.RP_PEROSN_ID and b.T_ID = c.RP_TRAIN_ID and d.INFO_ID=a.P_DEPARTMENT and b.T_ID='" + Request.QueryString["id"] + "' order by a.p_id desc";
当写在 protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
内不是就可以,
但是下面还有很多代码要调用这段SQL代码,所以,请问该怎么解决这个问题,