ASP/C# - insert textbox in new line after other specific element

79 Views Asked by At

I have a page with a set of elements. I would like my dropdownlist1 to create new textbox under another specific element. For example, if I have (from top to bottom):

  • Label1
  • dropdownlist1
  • textbox1
  • dropdownlist2
  • label2

I would like my dropdownlist1 to create textbox2 under dropdownlist2 when user selects some item in the dropdownlist1.

How can I accomplish this?

2

There are 2 best solutions below

0
On

don't bother... I found the answer... I should create an empty DIV between the elements I'm interested and when the dropdownlist changes to specific option, the code behond (C#) will create the new textbox in the empty DIV

1
On

Try to give your texbox2 initially display="none" property in CSS and place it where you want. Then create method, which will set it CSS property to for example 'inline-block' after assigning non-default value to variable which dropdownlist1 will set.