Skip to content

Dynamically create hiddenfield based on drodown list value

muthukumar

Asked Apr 23, 2015, 10:42 PM EDT1 answer
Share
LinkedInX
create hiddenfield based on dropdown list selected value 

i have a grdview with add new row button in each row i have dropdown control like below image  my req: when i select dropdown based on drodwn selected value create  one hidden field as store some value  if already selected value in another row of gridview dont create hidden field use already created hiddenfield whicih is previously selected

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Suthish Nair
    0
    Check for control exists or not. If not found create as below and add to the container. HiddenField hf1 = new HiddenField();
    hf1.ID = "hf1";

    Else, simply store the new value.
    0