add asp.net control using javascript

前端 未结 6 1520
广开言路
广开言路 2021-01-16 07:40

I would like to add an ASP:label and ASP:textbox control to a page through Javascript.



        
6条回答
  •  死守一世寂寞
    2021-01-16 07:50

    If there's a limit to the number of label/textbox pairs you'll be dynamically adding to your page, you could do something like hard-coding e.g. 10 of them but initially making them invisible using css properties. You could then change the css properties dynamically using javascript/jQuery.

    If you go down this path I'd put each label and textbox into a div which you can assign a fixed id and manipulate the properties of these div's instead of faffing around with ClientID's of the labels/textboxes.

提交回复
热议问题