Example #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string _Firstname = fname.Text.ToString();

            string _lastname = lname.Text.ToString();
            string _Email    = emailid.Text.ToString();
            string _Website  = website.Text.ToString();
            string _Phoneno  = phone.Text.ToString();
            string _type     = DropDownList1.Text.ToString();
            string _Address  = address.Text.ToString();
            string _Photos   = null;
            int    _Status   = 0;

            MYDAL MyobjDal = new MYDAL();

            _Status = MyobjDal.InsertContact(_Firstname, _lastname, _Website, _Phoneno, _Address, _type, _Photos, _Status);

            if (_Status == 1)
            {
                string script = "alert(\"Hello!\");";
                ScriptManager.RegisterStartupScript(this, GetType(),
                                                    "ServerControlScript", script, true);
                Response.Redirect("Contacts.aspx");


                return;

                //form1.InnerHtml = Convert.ToString("Login Successful!");
            }
            else
            {
            }
        }
Example #2
0
        protected void imgDeleteButton_Command(object sender, CommandEventArgs e)
        {
            int   contactid = Convert.ToInt32(e.CommandArgument.ToString());
            MYDAL MyobjDal  = new MYDAL();

            MyobjDal.DeleteContact(contactid);
            MessageBox.Show("Contact Deleted");
            Response.Redirect("Contacts.aspx");
        }