Cannot get radioButtonList selection

Discussion in 'ASP .Net Web Controls' started by VR, Jun 13, 2004.

  1. VR

    VR Guest

    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, Jun 13, 2004
    #1
    1. Advertising

  2. VR

    VR Guest

    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" <> wrote in message
    news:%...
    > 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, Jun 13, 2004
    #2
    1. Advertising

  3. VR

    kainhart Guest

    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
     
    kainhart, Jun 29, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZGhucml2ZXJzaWRl?=

    Setting RadioButtonList selection

    =?Utf-8?B?ZGhucml2ZXJzaWRl?=, May 10, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,953
    =?Utf-8?B?ZGhucml2ZXJzaWRl?=
    May 10, 2005
  2. Simon Niederberger
    Replies:
    2
    Views:
    16,816
    Christian Kaufhold
    Jan 7, 2005
  3. Andrew Crowe
    Replies:
    1
    Views:
    4,555
    Andrew Crowe
    Sep 13, 2004
  4. BizEd
    Replies:
    1
    Views:
    875
    Aamir Ghanchi
    Oct 2, 2007
  5. chief21
    Replies:
    0
    Views:
    850
    chief21
    Apr 9, 2009
Loading...

Share This Page