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

前端 未结 5 1333
难免孤独
难免孤独 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:04

    Hello it's not that easy to set data into HTML input, but here is a link that may help you [Link].

    1) If it didn't work up to you try to set a value and calling it through Javascript and set the text of this input like the gotten value.

    2) You can use the [Div] tag using runat="server", clear it and create a new input with same id,name,etc. but different Text value

    Try Step 2 as follow(it worked):

       
    divTitle.Controls.Clear(); divTitle.InnerHtml = "";

    Where ds is a data table that came from select query from database

提交回复
热议问题