I want to access the server side variable in javascript alert.
<asp:Button id="btnDelete" runat="server" class="deleteicon" Text='<%# Eval("iuser_id") %>' OnClick="deleteclick" onclientclick="return confirm('Are you sure you want to delete this record?'+<%# Eval("struser_name") %>);"/>
This is a delete button in a gridview. On click of it I want to alert the message and the user name. I am getting server tag is not formattted error.
Thanks,
EDIT
Attach javascript click function in rowDataBound event of the gridview safest and easy way to do it…code is as below
PRE
Try
JavaScript
HTML