Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi I have GridView And I want with Click on grid(select,Button or template button)
open PopUp Page and Pass The Query To PopUp Page?
i cant do it.
Please Help me.
Posted

 
Share this answer
 
Use ModalPopUp Extender
On rowCommand of Gridview use
C#
protected void fdhgfhgf(object sender, GridViewCommandEventArgs e)
   {
       try
       {
           int index = Convert.ToInt32(e.CommandArgument);
       GridViewRow row = GridView2.Rows[index];

           lblref.Text = row.Cells[1].Text;


           Session["refid"] = lblref.Text;
           SqlCommand cmd7 = new SqlCommand();
           cmd7.CommandText = "select_manpower_HOD";
           cmd7.CommandType = CommandType.StoredProcedure;
           cmd7.Connection = Db.GetConnection();
           cmd7.Parameters.AddWithValue("@RefrenceId",lblref.Text);
           SqlDataReader dr7 = cmd7.ExecuteReader();
           if (dr7.Read())
           {

               ddldeptt.Text= dr7["Department"].ToString();
               txtNoOfvacancies.Text = dr7["NoofVacancies"].ToString();
               txtDesignation.Text = dr7["Designation"].ToString();
               txtLocation.Text = dr7["Location"].ToString();
               txtExperience.Text = dr7["CoreExperience"].ToString();
               txtExpectedCTC.Text = dr7["ExpectedCTCAnnum"].ToString();
               txtMinExp.Text = dr7["Experiencemin"].ToString();
              txtMaxExp.Text = dr7["Experiencemax"].ToString();
              txtAge.Text= dr7["Age"].ToString();
               txtAcademicQuali.Text = dr7["AcademicQualification"].ToString();
              txtProfession.Text= dr7["ProfessionalQualification"].ToString();
               txtnature.Text = dr7["NatureOfVacancy"].ToString();
               txtImmdiateSuper.Text = dr7["ImmediateSuperior"].ToString();



           }
           cmd7.Connection.Close();
           this.modal1.Show();
       }
       catch (Exception ex)
       {
           Response.Write(ex.ToString());
       }

   }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900