Groups | Blog | Home
all groups > asp.net webcontrols > june 2004 >

asp.net webcontrols : Cannot get radioButtonList selection


VR
6/13/2004 3:09:33 PM
Hi, I'm developing a Web User Control and I put a RadioButtonList control
bound to a data source, set it's .dataSource, .dataTextField and
..dataValueField properties and when looking in IE's view source everything
is Ok (the control's and list's values) but when I submit it to the server
(I set autoPostBack = true) I cannot read the selection.

I'm trying to read it from my control's codeBehind file not from the WebForm
Container code behind and all I get is:

..selectedValue = ""
..selectedIndex = -1
..selectedItem = Nothing

PS: I declared the radioButtonList object in the code behind file with
Protected and WithEvents modifiers.

If someone knows anything that could help me...


Thanks a lot,
Victor




VR
6/13/2004 5:55:36 PM
After trying a lot of ways to solve my problem I found that I could retreive
the selectedValue using Request(rblList.UniqueID) but, let's say, I'm
getting my control's selected value from outside ASP.Net framework page
processing that should automatically make the selected value available to
server code using the object property, correct?


regards,
Victor




[quoted text, click to view]

kainhart
6/29/2005 9:54:54 AM

I have the same problem actually and I haven't gotten anywhere in abou
3 days trying to figure it out. It seems that it must be pag
life-cycle problem but I can't seem to figure it out. To Complicat
things too, it seems that implementing particular interfaces such a
IPostBackDataHandler actually change the ordering in whic
CreateChildControls is called. This problem is quickly showing
weakness of ASP.NET in presenting a simple programming model to th
developer


-
kainhar
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message760419.htm
AddThis Social Bookmark Button