G
gijeet
Hello,
is there a way call a javascript function directly from within asp
page?
Example, here is page load event in C#
protected void Page_Load(object sender, EventArgs e){
// create error
int Var0 = 0;
try {
int iVar1 = 8/Var0;
}
catch (Exception ex){
string sExMsg = ex.Message;
//javascript works fine with string constant
Response.Write("<script type='text/javascript'>alert('In Catch');</
script>");
//can write error to page no problem
Response.Write(sExMsg);
// would like a popup with error
Response.Write("<script language='javascript'>doAlert(" + sExMsg +
");</script>");
Response.Write("<script language='javascript'>function doAlert(sExMsg)
{alert(sExMsg);}</script>");
//write error to log since I can't pop-it-up
//StreamWriter sw = File.AppendText(Server.MapPath("~/error.log"));
//sw.WriteLine(sExMsg);
//sw.Close();
}
}
Any help for a newbie is appreciated
Gi
is there a way call a javascript function directly from within asp
page?
Example, here is page load event in C#
protected void Page_Load(object sender, EventArgs e){
// create error
int Var0 = 0;
try {
int iVar1 = 8/Var0;
}
catch (Exception ex){
string sExMsg = ex.Message;
//javascript works fine with string constant
Response.Write("<script type='text/javascript'>alert('In Catch');</
script>");
//can write error to page no problem
Response.Write(sExMsg);
// would like a popup with error
Response.Write("<script language='javascript'>doAlert(" + sExMsg +
");</script>");
Response.Write("<script language='javascript'>function doAlert(sExMsg)
{alert(sExMsg);}</script>");
//write error to log since I can't pop-it-up
//StreamWriter sw = File.AppendText(Server.MapPath("~/error.log"));
//sw.WriteLine(sExMsg);
//sw.Close();
}
}
Any help for a newbie is appreciated
Gi