Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In asp.net application i have use one datalist control,And one user control inside datalist control but i cant access that user control or its value in .cs file on click of save button.If you have any solution then please give me.
I want to get child control on save button click event.

Thanks,
Posted
Updated 25-Sep-11 23:43pm
v2
Comments
m@dhu 26-Sep-11 5:23am    
Did you try with findcontrol like
WebUserControl cntrl = (WebUserControl)e.Item.FindControl("myControl");

1 solution

hi,

By using the following code you can find child control in data control

C#
LinkButton lblqid = (LinkButton)e.Item.FindControl("LinkButton1");


Try this you can get best result.


All the Best
 
Share this answer
 
Comments
deepak chaudhari snk 26-Sep-11 5:40am    
But i need to find child control,on other button click i.e. save button click thats why i cant get e.Item.FindControl method.
Muralikrishna8811 26-Sep-11 6:08am    
k your save button is out side of data control

then use

datalist.items[rowindex].filndcontrol[""];

Member 10919952 13-Jul-14 4:21am    
please tell what will be row index in case of footer row
deepak chaudhari snk 27-Sep-11 11:00am    
Thank
Your solution working fine.
Muralikrishna8811 27-Sep-11 11:15am    
u r welcome

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