[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

SelectionList Value Field -> Option value attribute

Edmondo Pentangelo

4/7/2002 2:51:00 PM

Is there an easy way to customize the value attribute in the options of a
select (SelectionList SelectType=dropdown) before rendering ??

I need to catch the request that is coming back from a select rendered using
the Mobile Internet Toolkit SelectionList in a component that is not using
the ASP.NET data model but is just reading the posted request.

The problem is that when a selection is made I get only an index in the
selection list not the actual value of the selection. Also I don't have
access to the selectionList object when the component runs so there is no
way for me to map the posted index with the actual value.

Basically I have something like this:

Form form = new Form();
this.Page.Controls.Add(form);

ArrayList arrList = new ArrayList();
arrList.Add(new Activity("A", "Activity A"));
arrList.Add(new Activity("B", "Activity B"));
arrList.Add(new Activity("C", "Activity C"));
arrList.Add(new Activity("D", "Activity D"));
arrList.Add(new Activity("E", "Activity E"));
arrList.Add(new Activity("F", "Activity F"));

SelectionList list = new SelectionList();
list.ID = "Activity";
list.DataSource = arrList;
list.DataTextField = "Name";
list.DataValueField = "Id";
list.DataBind();
form.Controls.Add(list);

This renders on IE like this:

<select name="Activity">
<option value="0">Activity A
<option value="1">Activity B
<option value="2">Activity C
<option value="3">Activity D
<option value="4">Activity E
<option value="5">Activity F
</select>

When the request comes back I need to catch it from a component that is not
using the ASP.NET data flow....I basically need to have for my program to
run correctly something like this:

<select name="Activity">
<option value="A">Activity A
<option value="B">Activity B
<option value="C">Activity C
<option value="D">Activity D
<option value="E">Activity E
<option value="F">Activity F
</select>

Is there an easy way to do this without making changes in the various
adapters (HTMLAdap, WMLAdap....etc..) ??

Thanks,
Edmondo Pentangelo.
Altevie Technologies.
ITALY.


1 Answer

(Jeremy Bostron (MS))

4/9/2002 8:43:00 PM

0