Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET C#4.0
Hello,
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.

Regards.
Posted 17-Feb-13 20:46pm
Comments
Asim Mahmood at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
ankushbelorkar at 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)

  Print Answers RSS
0 OriginalGriff 385
1 Gihan Liyanage 308
2 Sergey Alexandrovich Kryukov 150
3 syed shanu 125
4 ChauhanAjay 120
0 Sergey Alexandrovich Kryukov 9,021
1 OriginalGriff 7,941
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100