Better way to find control in ASP.NET

Posted by Honey5 under ASP.NET on 1/6/2018 | Points: 10 | Views : 657 | Status : [Member] | Replies : 3
Hi,
I have a complex asp.net form, having even 50 to 60 fields in one form like there is Multiview, inside MultiView I have a GridView, and inside GridView I have several CheckBoxes.

Currently I am using chaining of the FindControl() method and retrieving the child ID.

Now, my question is that is there any other way/solution to find the nested control in ASP.NET.

Thank You
Kosmiktechnologies.com




Responses

Posted by: Evacoach on: 1/29/2019 [Member] Starter | Points: 25

Up
0
Down
Very useful information for people, I think this is what everyone needs.

Honey5, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sanasheikh on: 2/19/2019 [Member] Starter | Points: 25

Up
0
Down
avc

Honey5, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathyaprabha on: 3/5/2019 [Member] Starter | Points: 25

Up
0
Down
Theres a reason that ASP.Net does not look into your nested controls recursively by default:

Performance
Avoiding errors
Reusability
Consider you want to encapsulate your GridViews, Formviews, UserControls etc. inside of other UserControls for reusability reasons. If you would have implemented all logic in your page and accessed these controls with recursive loops, it'll very difficult to refactor that. If you have implemented your logic and access methods via the event-handlers(f.e. RowDataBound of GridView), it'll be much simpler and less error-prone.
http://www.trainingbangalore.in/tableau-training-in-bangalore.html

Honey5, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response