Click here to Skip to main content
15,906,106 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,
I have a linkbutton inside the datalist template field(lbInside)
now i want to access that linkbutton from html page like below,

XML
<act:ModalPopupExtender ID="TabContainer1_ModalPopupExtender" runat="server" TargetControlID="lbInside"
PopupControlID="replyPanel" DynamicServicePath="" Enabled="True">
</act:ModalPopupExtender>


Please help
Posted
Updated 1-Feb-12 0:30am
v3

As it's inside a template, lbInside does not exist, even in ASP.NET. It's a placeholder name, which will get replaced by individual names for each row. As such, I'm not sure if this is doable, given that you need to provide a name on the server. If you do it inside the template, then I think it will work.
 
Share this answer
 
Use
C#
LinkButton lnk=(LinkButton) DataList1.Items[yourItemIndex].FindControl("yourLinkButtonID");
 
Share this answer
 
v2
Comments
kishore Rajendran 1-Feb-12 0:22am    
Thanks for your answer..
But this is the way we use in code behind. not in HTML page
Anuja Pawar Indore 1-Feb-12 4:41am    
Added pre tag
You cannot assing the control of data control as the modalpopup TargetControlID But you can put the entire modalpopu inside the template field so and assign the linkbutton to the modalpopup
 
Share this answer
 
v2

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