Dear Friends,
I have a error in my .cshtml but can't find a reason why it is complaining about a invalid character.
I have a inline script section. see below:
}
<script>
function setBanner(bool){
if (bool == 'true')
{
$('.banner').attr('data', 'false');
$('.Priority-control').attr('value', false);
$('#image-source').attr('src', '/Content/images/Banner-laag.png');
} else {
$('.banner').attr('data', 'true');
$('.Priority-control').attr('value', true);
$('#image-source').attr('src', '/Content/images/Banner-important.png');
}
};
</script>
@Html.HiddenFor(m => m.FollowupId)
Before the closing tag it tells me I have a invalid character
'invalid character' </script>
I have 5 script sections. 3 of them are saying 'invalid character' in front of the closing tag of the script section.
Anyone who have a solution to fix this problem?
Removing and retype solves it till closing and reopening the document.
Potential fixes from 'Quick actions and refactoring' only gives the option to remove script section.
Update:
I runned
jslint
It is saying:
Expected '/'.
</script>
Can't see why...
What I have tried:
- Potential fixes from 'Quick actions and refactoring'
- Removing and retype script sections.
- combining all sections to one script section.
- restarting visual studio 2015.
- clean/ rebuild
- replacing qoute for double qoute.
- removing end tag {
- removing ;