Why does my save use the initial value of my TextBox and not the entered value?

前端 未结 6 1414
遥遥无期
遥遥无期 2021-01-01 16:19

I have a textbox on my website:


On page l

6条回答
  •  借酒劲吻你
    2021-01-01 16:58

    Page_Load executed each time page is loaded. Add IsPostBack check to reset text only on first page load:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Latitude.Text = thisPlace.Latitude;
        }
    }
    

提交回复
热议问题