TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Phani Kumar
NA
162
25.4k
how to find the parent control from child control event
Jan 20 2021 11:59 AM
Hi,
I have datalist control in that i have a link button, where linkbutton is the child control for datalist.
I have a linkbutton on click event, in this event how can find the datalist
please find the sample code of mine using to find
protected void lnkDelete_Command(object sender, CommandEventArgs e)
{
// DataList dlAttachements = (DataList)sender;
WTLinkButton linkbutton = (WTLinkButton)sender;
DataListItem item = (DataListItem)linkbutton.NamingContainer;
//GridEditableItem dataitem = (GridEditableItem)((WTLinkButton)sender).NamingContainer;
//WTLinkButton lnkDelete = dataitem.FindControl("lnkDelete") as WTLinkButton;
DataList dlist = Parent.FindControl("dlAttachements") as DataList;
DataList dataList = item.Parent.FindControl("dlAttachements") as DataList;
Thanks in advance for the help
Reply
Answers (
1
)
pass value from view to controller
Export view to word document in asp.net core