Microsoft JScript runtime error: Object expected
I'm getting this error when trying to post some data. Since i am a beginner , i dont know how to sort this out. i've uploaded the sample source code. Pls help me.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ShankeyPosted Sep 8, 2010, 8:10 AM
Please replace following all red lines with all blue lines in your Appraisal1.aspx.cs file. Reason is that your all session values are null and you are converting a null value to int,char so on.... as shown in below red lines. Dont forget to mark my answer as accepted if it helped you a little :)
**************************************
employee.CompanyId = (int)Session["Login_temp_CompanyID"];
l.CompanyID = (int)Session["Login_temp_CompanyID"];
s_login_role = (char)Session["Login_temp_Role"];
**********************
employee.CompanyId =(Session["Login_temp_CompanyID"] ==null? 0:(int)Session["Login_temp_CompanyID"]);
l.CompanyID = (Session["Login_temp_CompanyID"] == null ? 0 : (int)Session["Login_temp_CompanyID"]);
s_login_role = (Session["Login_temp_Role"] == null ? ' ' : (char)Session["Login_temp_Role"]);
Arunkumar EmmPosted Sep 9, 2010, 3:48 AM