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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Krishna GaradPosted Jan 13, 2012, 4:12 PM
like
DropDownList1.Items.Clear();
and then add new items in dropdownlist.
sumaira manzoor hussain khanPosted Jan 13, 2012, 8:56 AM
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 GaradPosted Jan 12, 2012, 8:59 AM
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 khanPosted Jan 12, 2012, 8:15 AM
Krishna GaradPosted Jan 12, 2012, 7:57 AM