I'm looking to do this :
ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('Vous n'avez pas les droits d'accès à cette application.');", true);
There is no way to formulate this french sentence without '
:
'Vous n'avez pas les droits d'accès à cette application.'
Javascript fail because (probably) when encountering that caracter it expect it to be the end of the string.
I tried lots of thing like \'
and '''
but... no luck...
You could try this one:
"alert(\"Vous n'avez pas les droits d'accès à cette application.\");"
Why this works?
For instance try to type this in the console of your browser (press F12 to go to the developer tools and the click on the console tab)
alert('Vous n'avez pas les droits d'accès à cette application.');
You will notice that 'Vous n' is interpreted as a string and of course you will; get the error that you have already mentioned in your answer. This may help you visualize the above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With