How to set html input type text value using ASP.NET C#?

前端 未结 5 1340
难免孤独
难免孤独 2021-02-04 18:31

I have an html control which I want to set its value .... here\'s the control:



        
5条回答
  •  遇见更好的自我
    2021-02-04 19:07

    Its old question , but may help someone.

    You have to use Request.Form to get and call .Value to set the value.

    HTML

     
    

    CODE BEHIND

        //To get value:
        string myname=Request.Form["first_name_txt"];
    
       // To set value:
        first_name_txt.Value="";
    

提交回复
热议问题