selectionList and datareader problem - Please Help!!

Discussion in 'ASP .Net Mobile' started by domchik, Sep 2, 2003.

  1. domchik

    domchik Guest

    I have a selectionList control bounded to a DataReader on a mobile
    form like this :


    cboStreetsSpecific.DataSource = drStreets;
    cboStreetsSpecific.DataTextField ="StreetName";
    cboStreetsSpecific.DataValueField ="StreetID";
    cboStreetsSpecific.DataBind();




    When I press a Command button and do Postback , I would like to
    retrieve the selected item's text and value. I've tried to do it
    inside Command_onClick event like this

    private void cmdContinue_Click(object sender, System.EventArgs e)
    {

    string str= cboStreetsSpecific.Items[cboStreetsSpecific.SelectedIndex].Value);
    }

    or like this :

    private void cmdContinue_Click(object sender, System.EventArgs e)
    {

    string str= cboStreetsSpecific.Selection.Value;
    }


    but it doesn't work. I also tried to retrieve it through Request
    object like this :

    string str= request.form["cboStreetsSpecific"].ToString();



    and it doesn't work either .

    When I do the same actions when the selectionList filled without
    DataReader all the above attempts to retrieve the selected value DO
    WORK !

    Please , tell me how can I get the selected value when the
    selectionList is bounded to datareader .

    Thanks a lot in advance !!
    domchik, Sep 2, 2003
    #1
    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. KK
    Replies:
    2
    Views:
    528
    Big Brian
    Oct 14, 2003
  2. Sanjay Sood

    SelectionList Problem

    Sanjay Sood, Jul 17, 2003, in forum: ASP .Net Mobile
    Replies:
    1
    Views:
    135
  3. Brad Wist

    SelectionList DataValueField problem

    Brad Wist, Jul 30, 2003, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    147
    Brad Wist
    Jul 30, 2003
  4. Ran

    Databound SelectionList Problem

    Ran, Aug 11, 2003, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    133
  5. leezard

    SelectionList problem

    leezard, Aug 17, 2003, in forum: ASP .Net Mobile
    Replies:
    1
    Views:
    139
    duncan mason
    Aug 21, 2003
Loading...

Share This Page