Click here to Skip to main content
15,302,644 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My form page is created with dynamic controls whose information is stored into database. when user fill all data and click submit button, i want to validate those controls and is validation successful save the user information into database. I have also applied Button click event handler but i am not able to identify which control is used for name and which for phone because i don't have control information in button click event handler. is there a way to send control information which i have retrieved from database to event handler so that i can identify controls on form depending on information which i have in database.

Asim Mahmood 18-Feb-13 2:52am
you must assign ID's to every control and when you will click on button all control will lost because you are creating dynamic controls, you will create controls again after clearing parent panel then you will get values use this lien this.Page.FindControl("ControlID"); i hope so you will solve you problem. Thanks

1 solution

ankushbelorkar 18-Feb-13 4:20am
Thanks for your reply, but in your solution field ID will be same all the time, but in my case it is going to change with every form. Field on the form are different depends upon user. and having different ID's. I can not apply any for loop to create control ID.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900