hello everyone;
how we can refresh current form of asp.net. if i press refresh button .
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Krishna GaradRank #191 · 12.8K reputationPosted Jan 12, 2012, 2:57 AM EST
sumaira manzoor hussain khanRank #8,900 · 214 reputationPosted Jan 12, 2012, 3:15 AM EST
Krishna GaradRank #191 · 12.8K reputationPosted Jan 12, 2012, 3:59 AM EST
protected void Page_Load(object sender, EventArgs e)
{
TextBox_pv_date.Text= System.DateTime.Now.ToLongDateString();
DropDownList_patient_reg_code.Items.Add("Choose");
SqlCommand cmd = new SqlCommand("select * from [clinic patient registartion]", connection.get());
SqlDataReader read = cmd.ExecuteReader();
while (read.Read())
{
DropDownList_patient_reg_code.Items.Add(read["patient reg code"].ToString());
}
read.Close();
DropDownList_patient_visit_pv_id.Items.Add("choose");
dropdown_list_patient_visit_OPD_CHARGES.Items.Add("choose");
DropDownList_patient_visit_patient_reg_code.Items.Add("choose");
doctor_id_list.Items.Add("choose");
SqlCommand cmd1 = new SqlCommand("select * from [clinic opd info]", connection.get());
SqlDataReader read1 = cmd1.ExecuteReader();
while (read1.Read())
{
DropDownList_patient_visit_pv_id.Items.Add(read1["pv id"].ToString());
dropdown_list_patient_visit_OPD_CHARGES.Items.Add(read1["opd charges"].ToString());
DropDownList_patient_visit_patient_reg_code.Items.Add(read1["patient reg code"].ToString());
doctor_id_list.Items.Add(read1["doctor id"].ToString());
}
read1.Close();
}and one more thing put the breakpoint on refresh click event check it is working or not if it is not working then on your page validation is there so set property of refresh button CausesValidation to false.
sumaira manzoor hussain khanRank #8,900 · 214 reputationPosted Jan 13, 2012, 3:56 AM EST
i want to fetch data from the grid of "opd info" in the dropdownlist such as pv id,patient reg code,doctor id, charges of "patient visit" form. if i press fetch button first time then the data fetched normally. but i fetched 2nd and 3rd time the new data placed normally in the dropdownlist of "patient visit" form . but the old data is duplicating . it means the old data comes twice and so on. i want to overright old data in these dropdownlists. i am sending my fetch button code and also screen shots.
Krishna GaradRank #191 · 12.8K reputationPosted Jan 13, 2012, 11:12 AM EST
like
DropDownList1.Items.Clear();
and then add new items in dropdownlist.