I have an ASPX page within my web application, I'm trying to create a string with multiple lines within a string and use it for this method
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + Message + "');", true);
This code is in the .cs file.
I tried multiple ways to create this string as multi lines but it seems it doesnt work, I have used methods like:
String Message = "Not Authorised to use Sysomos. "+ "<br>" + " Please Email Ian Atkinson for Authorisation";
String Message = "Not Authorised to use Sysomos. "+ Enviroment.NewLine + " Please Email Ian Atkinson for Authorisation";
Both these methods do not work. I have also tried a string builder and no luck.
Any suggestions??
Try this
String Message = "Not Authorised to use Sysomos. \\n Please Email Ian Atkinson for Authorisation";
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