How to change the value of an asp:textbox from javascript

前端 未结 4 1212
故里飘歌
故里飘歌 2021-01-06 23:48

I have an asp:textbox


and when a user clicks the \"Cancel\" button, I want to erase w

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-07 00:46

    I had the same problem. I solved it once I remembered there is a mangling going on with asp.net on the Ids.

    within my aspx, i had:

    
    

    further down, within a gridview (hence the use of "class" instead of "id"), i had a column which had an asp:TextBox:

    once i recalled the id mangling issue, it was just a case of changing the way i referenced the textbox:

    
    

提交回复
热议问题