Can’t access CommandArgument (LinkButton) in Javascript
Problem:
Cannot access CommandArgument value of ASP LinkButton from Javascript function
Solution:
Instead going for CommandArgument, there is a rather simple workaround to this. LinkButton has a “title” attribute and it can be used to pass values to Javascript function.
<script type="text/javascript">
function demo(sender){
alert(sender.title);
}
</script>
<asp:LinkButton ID="LinkButton1" runat="server"
OnClientClick="javascript:return demo(this);"
CausesValidation="false"
CommandName="name"
Text='<%# Eval("[ name]") %>'
title='<%# Eval("[ name]") %>'
CommandArgument='<%# Eval("[Id]") %>'>click</asp:LinkButton>
Source: http://forums.asp.net/p/1414937/3121669.aspx#3121669
Categories: Coding
asp.net, javascript, linkbutton

Genius, thanks!
The property doesnt need to be called ‘title’ either, it can be ‘id’ or whatever you choose!
Ta,
Ken
@ken, thanks!