c# .net change label text

前端 未结 6 1846
眼角桃花
眼角桃花 2021-01-05 07:21

Hello for I trying to use this code but for some reason it doesn\'t work. Really need help with this. The problem is that the label doesn\'t change name from \"label\" when

6条回答
  •  温柔的废话
    2021-01-05 07:41

    Have you tried running the code in the Page_Load() method?

    protected void Page_Load(object sender, EventArgs e) 
    {
    
             Label1.Text = "test";
            if (Request.QueryString["ID"] != null)
            {
    
                string test = Request.QueryString["ID"];
                Label1.Text = "Du har nu lånat filmen:" + test;
            }
    }
    

提交回复
热议问题