protected void btnDelete_Click(object sender, EventArgs e)
        {
            string strId = (string)Session["CurrentId"];

            String[] ids = new String[] { strId };

            SForce.SforceService sfdcbinding = new SForce.SforceService();

            SForce.LoginResult login_result = null;

            login_result    = sfdcbinding.login(strUserName, strPasswd);
            sfdcbinding.Url = login_result.serverUrl;
            sfdcbinding.SessionHeaderValue           = new SForce.SessionHeader();
            sfdcbinding.SessionHeaderValue.sessionId = login_result.sessionId;

            SForce.DeleteResult[] deleteResults = sfdcbinding.delete(ids);
            SForce.DeleteResult   deleteResult  = deleteResults[0];

            if (deleteResult.success)
            {
                lblErrorMessage.Text = "The record id: " + deleteResult.id + " is deleted successfully.";
                int nCurrentIndex = (int)Session["CurrentIndex"];

                nCurrentIndex--;
                //contact = (SForce.Contact)queryResult.records[nCurrentIndex];

                Sfdcbinding                    = new SForce.SforceService();
                CurrentLoginResult             = Sfdcbinding.login(strUserName, strPasswd);
                Sfdcbinding.Url                = CurrentLoginResult.serverUrl;
                Sfdcbinding.SessionHeaderValue = new SForce.SessionHeader();

                Sfdcbinding.SessionHeaderValue.sessionId = CurrentLoginResult.sessionId;
                strQuerySelectFromContact = "select Id, FirstName, LastName, MailingAddress, Email, MobilePhone, Phone from Contact order by LastName nulls last";
                queryResult = Sfdcbinding.query(strQuerySelectFromContact);

                nTotalRecord = queryResult.size - 1;

                contact = (SForce.Contact)queryResult.records[nCurrentIndex];

                txtFirstName.Text = contact.FirstName;
                txtLastName.Text  = contact.LastName;

                if (contact.MailingAddress != null)
                {
                    txtStreetAddress.Text = contact.MailingAddress.street;
                    txtCity.Text          = contact.MailingAddress.city;
                    txtState.Text         = contact.MailingAddress.state;
                    txtZip.Text           = contact.MailingAddress.postalCode;
                }
                else if (contact.MailingAddress == null)
                {
                    txtStreetAddress.Text = "";
                    txtCity.Text          = "";
                    txtState.Text         = "";
                    txtZip.Text           = "";
                }

                txtMobilePhone.Text     = contact.MobilePhone;
                txtPhone.Text           = contact.Phone;
                txtEmail.Text           = contact.Email;
                Session["CurrentIndex"] = nCurrentIndex;

                if (nCurrentIndex == 0)
                {
                    btnPrev.Enabled  = false;
                    btnFirst.Enabled = false;
                }

                strId = contact.Id;
                Session["CurrentId"] = strId;
            }
            else
            {
                lblErrorMessage.Text = "Error: " + deleteResult.errors[0].message;
            }
        }