C# .NET - delete button in datalist

Asked By San B M on 10-Aug-10 02:16 AM
Hi all,

i am trying to display all users queries in my web page, now i want to give delete permission to user who raised query,
delete button is only visible in queries of their respected user only.
means for other user who loged in our web page the delete button is visible for his queries only, not to others.
i am using datalist control to display the queries.

Thanks
Santhosh N replied to San B M on 10-Aug-10 02:19 AM
You could do that in deletecommand event of the datalist and control which rows he can and cannot by retrieving the owner of the row ( item)
http://msdn.microsoft.com/en-us/library/b7y72882(VS.71).aspx
San B M replied to Santhosh N on 10-Aug-10 02:25 AM
if A B C D are users

if A is loged in then, he is able to see all users queries in web page, but he can view the delete button is only visible in front of his queries.
means no need to diaplay delete button infront of all queries, its only visibel to their respected user, one who raised the query.

Thanks