I have developed these 2 JS that I find useful in my Web Development.
You can cut and paste as a class within your source code, and use the Static Class methods.
You need to use Response.Write(one of the 2 static methods).
Here are the codes:
public class clUtilJS
{
// To form an JS Alert Message
static private string jsText1 =
"<script language=javascript>alert(\"";
static private string jsText2 = "\")</script>";
static private string jsSelfClose =
"<script language=javascript>self.close();</script>";
public clUtilJS()
{
//
// TODO: Add constructor logic here
//
}
static public string SetJSAlert(string INMsg)
{
// Format the JS statement to be Send to the Browser
return (jsText1 + INMsg + jsText2);
}
static public string JSSelfClose()
{
// Return the Javascript for self.close
return jsSelfClose;
}
}
Feedback for improvement are welcomed.
You can cut and paste as a class within your source code, and use the Static Class methods.
You need to use Response.Write(one of the 2 static methods).
Here are the codes:
public class clUtilJS
{
// To form an JS Alert Message
static private string jsText1 =
"<script language=javascript>alert(\"";
static private string jsText2 = "\")</script>";
static private string jsSelfClose =
"<script language=javascript>self.close();</script>";
public clUtilJS()
{
//
// TODO: Add constructor logic here
//
}
static public string SetJSAlert(string INMsg)
{
// Format the JS statement to be Send to the Browser
return (jsText1 + INMsg + jsText2);
}
static public string JSSelfClose()
{
// Return the Javascript for self.close
return jsSelfClose;
}
}
Feedback for improvement are welcomed.
