strPropertyID设置static
或者用ViewState,Session等记录strPropertyID;
因为Web编程是无连接的

解决方案 »

  1.   

    qiushuiwuhen(秋水无恨) :设置static恐怕不太好吧,一个用户该了这个值,其它地方得到这个变量值会随之更改的.你说用session,s是说我直接定义一个:如:Session["PropertyId"]=strPropertyID,是吧?!
    ViewState是怎样用的,干什么的?能说明一下吗?
      

  2.   

    主要是因为你在B页面的其他事件引起了 postback,而你的程序只有在
    !Page.IsPostBack 时才取得 strPropertyID的值。public string strPropertyID;
    private void Page_Load(object sender, System.EventArgs e)
    {

    // Put user code to initialize the page here
    //Tool.checkRightsAndPropetyID(this); strPropertyID = Context.Items["PropertyID"].ToString();
    BlockCode_Textbox.Text =Context.Items["Block Code"].ToString();
    BlockName_TextBox.Text = Context.Items["Block Name"].ToString();
    Manager_TextBox.Text = Context.Items["Manager"].ToString();
    CommenceDate_TextBox.Text =Context.Items["Commence Date"].ToString();

    }