RadiobuttonList and Calendar
-
im creating radioButtonList Dynamically & set Autobostback = true then i put a radiobuttonlist i created in every Cell in asp Calendar .. when i choose any item in the radiobuttonlist .. no post back happen :( any solution ?? :(
did you used Ajax in the page
cheers, Abhijit
-
did you used Ajax in the page
cheers, Abhijit
yes i used ajax but not with the calendar and not with the radiolist
-
yes i used ajax but not with the calendar and not with the radiolist
Just try with this, I think you did not add event handler while creating RadionButtonList Dynamically. You need to deleget the event to fire . Let me know when done.
protected void Page_Load(object sender, EventArgs e) { RadioButtonList dbl = new RadioButtonList(); dbl.ID = "asdfdf"; dbl.Text = "test"; dbl.SelectedIndexChanged += new EventHandler(dbl_SelectedIndexChanged); } void dbl_SelectedIndexChanged(object sender, EventArgs e) { throw new Exception("The method or operation is not implemented."); }
cheers, Abhijit
-
Just try with this, I think you did not add event handler while creating RadionButtonList Dynamically. You need to deleget the event to fire . Let me know when done.
protected void Page_Load(object sender, EventArgs e) { RadioButtonList dbl = new RadioButtonList(); dbl.ID = "asdfdf"; dbl.Text = "test"; dbl.SelectedIndexChanged += new EventHandler(dbl_SelectedIndexChanged); } void dbl_SelectedIndexChanged(object sender, EventArgs e) { throw new Exception("The method or operation is not implemented."); }
cheers, Abhijit
i did what u told me .. but still no postback .. :( :( ... i need a solution plz
-
i did what u told me .. but still no postback .. :( :( ... i need a solution plz
ok, now i have got the point . set AutopostBack=true ; with that code, which i had mistake and add your control in a Panel which is set to be run at server. this will work
protected void Page_Load(object sender, EventArgs e) { RadioButtonList dbl = new RadioButtonList(); dbl.ID = "MyID"; dbl.Items.Add("abhijit"); dbl.Items.Add("Jana"); dbl.SelectedIndexChanged += new EventHandler(dbl_SelectedIndexChanged); dbl.AutoPostBack = true; Panel1.Controls.Add(dbl); } void dbl_SelectedIndexChanged(object sender, EventArgs e) { throw new Exception("The method or operation is not implemented."); }
dont forget to vote if its helps you ;)cheers, Abhijit
-
ok, now i have got the point . set AutopostBack=true ; with that code, which i had mistake and add your control in a Panel which is set to be run at server. this will work
protected void Page_Load(object sender, EventArgs e) { RadioButtonList dbl = new RadioButtonList(); dbl.ID = "MyID"; dbl.Items.Add("abhijit"); dbl.Items.Add("Jana"); dbl.SelectedIndexChanged += new EventHandler(dbl_SelectedIndexChanged); dbl.AutoPostBack = true; Panel1.Controls.Add(dbl); } void dbl_SelectedIndexChanged(object sender, EventArgs e) { throw new Exception("The method or operation is not implemented."); }
dont forget to vote if its helps you ;)cheers, Abhijit
still no post back .. i don't know why ????????????? any controls added to the calendar cell doesn't postback .. :( outside the calendar it posts back normally .. but inside it noooooooooo ..
-
still no post back .. i don't know why ????????????? any controls added to the calendar cell doesn't postback .. :( outside the calendar it posts back normally .. but inside it noooooooooo ..
just post your code over here. i need to check it now !!!
cheers, Abhijit
-
just post your code over here. i need to check it now !!!
cheers, Abhijit
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { RadioButtonList RBL_Absence = new RadioButtonList(); RBL_Absence.SelectedIndexChanged += new EventHandler(RBL_Absence_SelectedIndexChanged); RBL_Absence.EnableViewState = true; RBL_Absence.AutoPostBack = true; RBL_Absence.ID = "RBL_Absence" + e.Day.Date; RBL_Absence.RepeatDirection = RepeatDirection.Vertical; RBL_Absence.Font.Size = FontUnit.Point(8); DataSet DS_AbsenceType = _Attend.Get_All_AbsenceType(); RBL_Absence.DataSource = DS_AbsenceType; RBL_Absence.DataTextField = "AbsenceType"; RBL_Absence.DataValueField = "AbsenceType_ID"; RBL_Absence.DataBind(); //*********************************************************** e.Cell.Controls.Add(RBL_Absence); e.Cell.HorizontalAlign = HorizontalAlign.Center; }
-
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { RadioButtonList RBL_Absence = new RadioButtonList(); RBL_Absence.SelectedIndexChanged += new EventHandler(RBL_Absence_SelectedIndexChanged); RBL_Absence.EnableViewState = true; RBL_Absence.AutoPostBack = true; RBL_Absence.ID = "RBL_Absence" + e.Day.Date; RBL_Absence.RepeatDirection = RepeatDirection.Vertical; RBL_Absence.Font.Size = FontUnit.Point(8); DataSet DS_AbsenceType = _Attend.Get_All_AbsenceType(); RBL_Absence.DataSource = DS_AbsenceType; RBL_Absence.DataTextField = "AbsenceType"; RBL_Absence.DataValueField = "AbsenceType_ID"; RBL_Absence.DataBind(); //*********************************************************** e.Cell.Controls.Add(RBL_Absence); e.Cell.HorizontalAlign = HorizontalAlign.Center; }
i am realy sorry that i am not able to find the problem, i have tried but no result. i can give you one idea, that if you have no problem you can use Array of Radio button with same Group name ..
cheers, Abhijit
-
i am realy sorry that i am not able to find the problem, i have tried but no result. i can give you one idea, that if you have no problem you can use Array of Radio button with same Group name ..
cheers, Abhijit
thx alot for your effort .. i really appreciate that .. another question plz : how can i loop into calendar to find The control in every cell ?
-
thx alot for your effort .. i really appreciate that .. another question plz : how can i loop into calendar to find The control in every cell ?
legend_of_zanado wrote:
thx alot for your effort .. i really appreciate that ..
Thanks for that. then you have to rate my post
legend_of_zanado wrote:
how can i loop into calendar to find The control in every cell ?
i am trying , let you kwno when done.
cheers, Abhijit