i have the code...
try { do something..
    }
    catch(Exception ex)
    {
         Response.Write("<script>alert('"+ex+"')</script>");
    }
but the alert box is not displaying...
if i use the code.
    try{do some thing}
    catch (Exception ex)
    {
        Response.Write("<script>alert(\"an error occur\")</script>");
    }
alert box appears.... how could i can display the exception variable in alert box