I wrote the code below to check for an empty value in my text box, but its compilation generation failed, please provide me a solution.
my javascript code is:
function checkTextboxNotFilled(txtbox) {
var txtb = document.getElementById("<%= " + txtbox + ".ClientID %>");
if (GetFormattedString(txtb.value) == "") {
return true ;
}
else {
return false ;
}
}
Error:
'string' does not contain a definition for 'ClientID' and no extension method 'ClientID' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
I call it like this: checkTextboxNotFilled ("MytextboxName")
source
share