D
domchik
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 !!
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 !!