Hidden value assigned in js lost after postback

前端 未结 3 912
温柔的废话
温柔的废话 2020-12-16 01:33

Here\'s my problem. I have a hidden field whose value I change through a javascript method. The problem is after postback the value is lost.

How can I persist the va

3条回答
  •  情歌与酒
    2020-12-16 02:22

    You don't need to have the hidden input run at server. You can do:

    
    

    Then when you post back you can access it like that:

    protected void BtnGuardar_Click(object sender, EventArgs e)
    {
        String test = Request.Form["HiddenInput"];
    }
    

提交回复
热议问题