I have a javascript function that has 5 parameters. I need to pass a large amount of text (it is a stack trace from C#.net code behind to the js function
Code :
function createDIV(CLASS_NAME, METHOD_NAME, APPLICATION_NAME, EXCEPTION_MESSAGE, STACK_TRACE_TEXT, EXCEPTION_OCCURANCE_STATUS) {
\\processing the code
}
When I call this function it works for all other values but if the text contains \n it fails
sample text : org.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.\n\tat org.apache.struts.chain.commands.AbstractSelectAction.execute(AbstractSelectAction.java:68)\n\tat
Calling code:
ClientScript.RegisterStartupScript(
GetType(),
"sss",
"createDIV(
'" + CLASS_NAME.ToString() + "','" + METHOD_NAME.ToString() + "','" +
APPLICATION_NAME.ToString() + "','" + EXCEPTION_MESSAGE.ToString() + "','" +
STACK_TRACE.ToString() + "');",
true);
I'm also unable to replace the \n with its html equivalent in C#.net. it just returns -1 for its occurance
Please help