Re: Cannot get radioButtonList selection

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: stuart (stuart_at_discussions.microsoft.com)
Date: 06/14/04


Date: Mon, 14 Jun 2004 07:49:01 -0700

Hi there,

I'm getting something similar with the checkboxlist server control. I have the control declared in my aspx file normally but on submitting the page I want to itterate through the data bound collection and the selected value is constantly set at false regardless of the controls state.

a) When looking at the url with method=get I see the controls that are selected, but the controls themselves don't retain thier state (regardless of EnableViewState)

The code is below in my OnSubmit event handler:

'----Are any of our list items checked?
For intLoop = 0 To cblSections.Items.Count - 1 Step 1
    If cblSections.Items(intLoop).Selected Then
        '----Whatever, is always false.
    End If
Next intLoop

Hope someone can help...

"VR" wrote:

> 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
>
>
>
>
> "VR" <vcreb@hotmail.com> wrote in message
> news:%23mbPsGXUEHA.2944@tk2msftngp13.phx.gbl...
> > 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
> >
> >
> >
> >
> >
>
>
>



Relevant Pages

  • RE: Dynamic control creation.
    ... although you can create checkboxes using ... example you can check the values of those dynamically created controls as ... created depending on the option the user has selected in the Dropdown. ... when i try dong this in this event i dont see the SelectedValue of the ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • RE: Dynamic control creation.
    ... Once i have created these checkboxes dynamically then what i have on the ... controls) recreates the 3 checkboxes. ... created depending on the option the user has selected in the Dropdown. ... when i try dong this in this event i dont see the SelectedValue of the ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • RE: Dynamic control creation.
    ... although you can create checkboxes using ... example you can check the values of those dynamically created controls as ... created depending on the option the user has selected in the Dropdown. ... when i try dong this in this event i dont see the SelectedValue of the ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • RE: Dynamic control creation.
    ... like any other server control unless it is created in the page ... These dynamic controls ... created depending on the option the user has selected in the Dropdown. ... when i try dong this in this event i dont see the SelectedValue of the ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • visual precede Denzlers poster
    ... As inevitably as Morris features, ... Thomas controls the airport until hers and differently ... attempt regardless, then regard because of the change unlike the ... Better differentiate parameters now or Clint will probably classify them ...
    (sci.crypt)