I am using an inline jquery in the c# code and it works. But when I try to call it through js file, it does not work.
C# code
tableCell.Attributes.Add("onclick",
@" if($(""div[id*='Name'] input[id*='" +
checkboxID + @"']"").is(':checked')" );
Here, I get the value true. So Now I try to make a function in js file and call it.
tableCell.Attributes.Add("onclick",
"javascript:Foo(this,'" + checkBoxID + "');
return false;");
Js File :
function ToggleScorecardConfig(sender,checkboxID) {
var a = checkboxID + "@";
alert(a); //WORKS
alert($(""div[id*='Name'] input[id*='" + checkBoxID +
@"']"").is(':checked')); //ERROR : ')' Expected
}
I know I am doing some very small mistake, Can anyone please guide me.