Currently, You are passing eid
as hard-coded text to onclick
handler, Which treats it as JavaScript variable thus you are getting an error
JavaScript runtime error: 'eid' is undefined
Now, In C# code eid
is a variable thus you need to pass it as
cbx.Attributes.Add("onclick", "update(" + eid +");");