i have made a massenger chat project in C# asp net.
after login, you find any members in a page, where you can send you messages. for this i need to get accdess to controls in datalist, which are image of the suctomer and its name (which is a linkbutton)... when i press linkbutton to get the name, the string variable is empty???!!! i used other option, but it stands the last name in the list of customers???!!!
i attach the codes thanks
/forums/uploadfile/a8d6ef/02022023171459PM/codes.pdf
Naimish MakwanaPosted Feb 3, 2023, 3:20 AM
Hi Venus,
To get access to controls inside a DataList control in C# ASP.NET, Please try the below code.
DataList control, for example a LinkButton with ID "LinkButton1".
In the code-behind, you can access the control in the ItemDataBound event of the DataList:
For handle the Click event of the LinkButton control, you can add a Command event handler to the DataList control:
Thanks
Naimish Makwana