Home > Forums > Regular Expressions >


alert message not showing new line

Posted by Shoyebaziz123 under Regular Expressions on 6/23/2011 12:30:12 AM | Points: 10 | Views : 2257 | Status : [Member] | Replies : 2
Hi all,
i am using this code for showing alert message but it not working , if i am using \n

protected void Button1_Click(object sender, EventArgs e)
{

if(clsValidation.Return_Date(txtDate)==true)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "test", "alert('Ok')", true);
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "test", "alert('Enter Valid Date \n in dd/mm/yyyy format')", true);
}


}

working if \n not use what is the reason , any solution?
thanks




Responses

Posted by: Navalemanoj0405 on: 6/23/2011 [Member] Starter | Points: 25
Dear Shoyebaziz123,
try this:

ScriptManager.RegisterStartupScript(this, this.GetType(), "test", "alert('Enter Valid Date \\n \\n in dd/mm/yyyy format')", true);

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator
Posted by: Lakn2 on: 6/24/2011 [Member] Starter | Points: 25
try this

page.registerstartupscript("<script>","<script>alert( ' your message or variables in string ' ) </script>");



Thanks&Regards
LakshmiNarayana Nalluri.

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response