liorlankril
Programmer
I have a User Control that contain this c# code:
public partial class MyUC: Moia.Components.BaseUserControl
{
protected string str = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
this.str= "aaa";
string strScriptKey = "Replace";
string strScriptCode = "<script type='text/jscript' language='javascript'> " +
"function ShowAlert(strToShow) " +
"{ " +
"alert(strToShow); " +
"} "+
"ShowAlert(" + this.str +"); "+
"</script>";
if (!Page.IsClientScriptBlockRegistered(strScriptKey))
Page.RegisterClientScriptBlock(strScriptKey,
strScriptCode);
}
As you can see, all I did is define string str="aaa" and to Register javascript code that contain function (ShowAlert) and calling to this function with "str" as parameter.
I get an error on page : 'aaa" is undefiend
What is the problem?????