ASP.NET - When passing onclick="ShowValue(99991-002);return false;" its returning 99989.

Asked By sumit@123 Jadhav on 03-Feb-14 04:16 AM
I want to pass "99991-002" as string.

OnClientClick='<%# String.Format("ShowValue({0});return false;",Convert.ToString(Eval("ID")))%> '

If ID=99991-002 its passing 99989(99991-002=99989) . But I want to pass "99991-002 "

Robbe Morris replied to sumit@123 Jadhav on 03-Feb-14 02:40 PM
string values in JavaScript need to be passed in with single quotes around the value.