asp.net code
public static int insertcustomer(string bcode, string bname, string agentcode, string agentname, string cid, string rdate, string name, string father, string mother, string bdate, string mobile, string telephone, string email, string address, string city, string state, string pin, string pan, string adhar)
{
Registration regi = new Registration();
Encryption ecrp = new Encryption();
Database db = new Database();
string pass = ecrp.Encrypt(db.Generatepass());
agentcode = "1234";
string a = regi.custregistration(1, Convert.ToDateTime(rdate), 1, name, father, "", address, city, state, Convert.ToInt32(pin), "", "", "", "", "", "", 0, DateTime.Now, Convert.ToDateTime(bdate), pan, "", "", "", "", agentname, "", Convert.ToInt32(agentcode), DateTime.Now, "", "", DateTime.Now, 1, Convert.ToInt32(cid), file1,file2,file3,file4,file5,mother,adhar,bcode, pass, "Insert");
if (a == "SUCCESSFUL")
{
return 1;
}
else
{
return 2;
}
}
javascript code:
PageMethods.insertcustomer(bcode, bname, agentcode, agentname, cid, rdate, name, father, mother, bdate, mobile, telephone, email, address, city, state, pin, pan, adhar, OnSuces);
clear();
function OnSuces(result) {
if (result == 1) {
alert('Customer Registered Successfully');
document.getElementById('<%=Panel2.ClientID %>').style.visibility = "hidden";
document.getElementById('<%=Panel3.ClientID %>').style.visibility = "hidden";
clear();
}
else {
alert('Customer Registration failed');
document.getElementById('<%=Panel2.ClientID %>').style.visibility = "hidden";
document.getElementById('<%=Panel3.ClientID %>').style.visibility = "hidden";
clear();
}
}
}
all code work but result message not show why