Link to home
Start Free TrialLog in
Avatar of eteran
eteranFlag for United States of America

asked on

Asp.net add html controls to aspx form at run time , use them like server controls



Hi ,

I have to  add html to my aspx form at run time and use added  controls as server cotrols ..
let says
 I need to create one form in which html comes from db . and then control in that behave like server control .
 
  first table that contains html for form  .

 <table><tr><td>First name</td><td><input type="text" name="fist_name" size="40" ></td></tr>
        <tr><td>Last name</td><td><input type="text" name="last_name" size="20" ></td></tr>
</table > 

and  second table that contains two field fist_name and last_name .  
when i run that from it show two text box (above html of first table  ) and
on button click value of textboxex to be save in second table  .
please help .
thanks  in advance
ASKER CERTIFIED SOLUTION
Avatar of abel
abel
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To work with dynamic controls and to create them is a lot of work. All you said in your post can also be done by just typing that structure in the  ASPX page and giving the relevant elements an runat="server" to make them server controls. The button should be an asp:Button and the textboxes should be asp:TextBox to make it easier to reference them.
Avatar of eteran

ASKER

hi abel  thanks for reply
   i have  add lots of html and we can't break it  .
  So we can't use your first way we are already using that .
  we have to add html as it is ...
thanks
@TheLearnedOne: it might be that you misinterpreted the last comment of "eteran", here's my reading of the same:

>> "so we can't use your first way". My "first way" was the suggestion to use a gridview.
>> "we have to add html as it is". That was what I showed as an example. The asker here confirms that he's going for my approach, which is shown in the comment of http:#24190323

And then forgot to grade... ;-)