The controls you restore from the session have nothing to do with the values
you are getting in postbacks. You don't need to use session. Since you
create the radiobuttons dynamically, you need to re-create them on every
postback and then they will pick up the posted values. A good practice is to
re-create the dynamic controls in the Init event.
Here is a good article:
Dynamic Web Controls, Postbacks, and View State
http://aspnet.4guysfromrolla.com/articles/092904-1.aspx
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Igor" <(E-Mail Removed)> wrote in message
news:endpfi$530$(E-Mail Removed)...
> "DeveloperX" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> They're very different beasts. What are you trying to achieve, perhaps
>> we could suggest an alternative approach with some more detail.
>
> I make radiobutton array. Then user click on some radiobutton. After that
> program must see which of these radiobuttons have property checked=true.
> but every radiobutton have property false. Look at this:
> Dim rb(0 To 2) As RadioButton
> Dim n As Integer
>
> For n = 0 To 2
> rb(n) = New RadioButton
> rb(n).Text = "Text: " + CStr(n)
> rb(n).Groupname="Group1"
> Panel1.Controls.Add(rb(n))
> Next
> Session("rb") = rb
>
>
> Than I call this RadioButton array from session to other procedure:
>
> Dim rb(0 To 2) As RadioButton
> rb = Session("rb")
> Response.Write(rb(0).Checked)
> Response.Write(rb(1).Checked)
> Response.Write(rb(2).Checked)
>
>
> Problem is next: Every RadioButton have property Checked=False even when
> user check some button. Text property is ok, but checked property is False
> every time.
>
> How to fix it?
>
>