G
Guest
Please check the string in "stralertscript ".
if ( ds.Tables["studentTestpaper"].Rows.Count == 0 )
{
stralertscript = "<script language='javascript'> "+
" function alert() "+
" { "+
" alert ('Testpaper not found'); "+
" return true; "+
" } </script> ";
Page.RegisterStartupScript ("stralertscript", stralertscript);
}
What I wanted to do was to pop up an alert message. The IF function works
fine, but the alert doesn't appear. Should I use RegisterStartupScript or
RegisterClientScriptBlock ?
TIA
Andrew.
if ( ds.Tables["studentTestpaper"].Rows.Count == 0 )
{
stralertscript = "<script language='javascript'> "+
" function alert() "+
" { "+
" alert ('Testpaper not found'); "+
" return true; "+
" } </script> ";
Page.RegisterStartupScript ("stralertscript", stralertscript);
}
What I wanted to do was to pop up an alert message. The IF function works
fine, but the alert doesn't appear. Should I use RegisterStartupScript or
RegisterClientScriptBlock ?
TIA
Andrew.