Click here to Skip to main content
15,909,953 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Geeks

Just a small verification. string values doesn't pass exactly to the below code.
Is this wrong?

C#
string characters="/;*?<>|";             
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('A file Name cant contain any of the operators'"+characters+"')", true); 


Suggest me how to pass string values?

Thanks in advance
Posted

1 solution

Try this:
XML
string script = @"alert('A file name cannot contain any of the operators \'/;*?<>|\'')";
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", script, true);
 
Share this answer
 
Comments
Sriram Ramachandran 25-Jun-14 3:49am    
yup it works .. thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900