manishbhushan
June 27th, 2005, 12:13 AM
I was trying to load radio button on the form at runtime.
How should i go for that .....
How should i go for that .....
|
Click to See Complete Forum and Search --> : How should i load my control at run time ..?? manishbhushan June 27th, 2005, 12:13 AM I was trying to load radio button on the form at runtime. How should i go for that ..... Andy Tacker June 27th, 2005, 02:31 AM in form load function.... RadioButton m_MyRB = new RadioButton(); m_MyRB.location = new location(iX,iY); m_MyRB.Size = new Size(iW,iH); this.Controls.add(m_MyRB); manishbhushan June 27th, 2005, 04:28 AM i was trying with this code while(OptionReader.Read()) { Response.Write("<br>"+OptionReader.GetValue(2)); rdo_opt = new RadioButton(); rdo_opt.ID="rdo_" + OptionReader.GetValue(0) ; rdo_opt.GroupName =getQsplit.GetValue(0).ToString(); rdo_opt.Text = OptionReader.GetValue(2).ToString(); this.Controls.Add(rdo_opt); } and then error comes with this message... Control 'rdo_1' of type 'RadioButton' must be placed inside a form tag with runat=server. exterminator June 27th, 2005, 05:04 AM You had not clarified what kind of form and I guess what Andy has suggested deals with Window-forms and not web-forms. You should be clear with your question. Shouldnt you ? So your error message suggests you something doesnt it? Why not make those changes? Try it out and lets see what issues do you get next. All the best...Cheers, Exterminator manishbhushan June 27th, 2005, 07:17 AM I was trying to load radio button on the web form at runtime. How should i go for that ..... Could we create web control at runtime ...? how should we go for that...?? exterminator June 27th, 2005, 09:24 AM Yes. we can, for sure, do that. This link might prove helpful to you. http://aspnet.4guysfromrolla.com/articles/081402-1.aspx codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |