Alter Message box from code Behind in C# Asp.Net

Alter Message Box from Code Behind


Response.Write(@"<script language='javascript'>alert('The following errors have occurred:" + ErrorDesc + ".');</script>");

Now if you want error message in secondLine.
here the trick.

Response.Write(@"<script language='javascript'>alert('The following errors have occurred: \n" + ErrorDesc + " .');</script>");

or you can double escape the \n by doing 

Response.Write(@"<script language='javascript'>alert('The following errors have occurred: \\n" + ErrorDesc + " .');</script>");

Posted in |

0 comments:

Post a Comment