protected void Show()
 {
     con.getConnection();
     cmd.CommandText   = "select top 3 * from Blog order by NEWID()";
     cmd.Connection    = con.getConnection();
     sdr.SelectCommand = cmd;
     sdr.Fill(ds, "BDescription");
     Repeater1.DataSource = ds;
     Repeater1.DataBind();
 }
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Models.Connection con   = new Models.Connection();
            string            query = "select UEmail from UserReg where UName = '" + DropDownList1.Text + "'";
            SqlCommand        com   = new SqlCommand(query, con.getConnection());
            SqlDataReader     rd    = com.ExecuteReader();

            while (rd.Read())
            {
                u.UEmail = rd["UEmail"].ToString();
            }
            TextBox8.Text = u.UEmail;
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Models.Question ques = new Models.Question();
            ques.DateQuest = DateTime.Now.ToString();
            string query = "select Uid from UserReg where UEmail = '" + Session["UserInfo"].ToString() + "'";

            ques.Quest = TextBox1.Text;
            Models.Connection con  = new Models.Connection();
            SqlCommand        com5 = new SqlCommand(query, con.getConnection());
            SqlDataReader     rd   = com5.ExecuteReader();

            while (rd.Read())
            {
                ques.Uid = Convert.ToInt32(rd["Uid"]);
            }
            ques.Add(ques);
            Response.Write("<script>alert('Published...Please wait for the reply')</script>");
            Models.ClearText ct = new Models.ClearText();
            ct.ClearTextbox(TextBox1);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Models.Email      ee  = new Models.Email();
            Models.Connection con = new Models.Connection();
            SqlCommand        com = new SqlCommand("select * from login", con.getConnection());
            SqlDataReader     rd  = com.ExecuteReader();

            while (rd.Read())
            {
                ee.email = TextBox1.Text;
                string em   = rd["Email"].ToString();
                string pass = rd["Password"].ToString();
                if (ee.email == em)
                {
                    ee.Body    = pass;
                    ee.Subject = "Password Recovery";
                    //ee.email = em;
                    ee.SendEmail(ee);
                    Response.Write("<script>alert('Email Sent Successfully')</script>");
                }
            }
        }