|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
unselectable datacomboare selectable! I put a label on the page below the datacombo and selecteditem.text will populate the list when I change the selection combo for either of the first two items, but not for any of the others. I'm using database objects to populate the Datacombo. The code is: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here If Not IsPostBack Then odaParam.Fill(DsParam2) cmbParam.DataBind() End If End Sub Private Sub cmbParam_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbParam.SelectedIndexChanged Label1.Text = cmbParam.SelectedItem.Text End Sub The HTML is: <P> <select name="cmbParam" onchange="__doPostBack('cmbParam','')" language="javascript" id="cmbParam"> <option value="0"> Select..</option> <option value="S">Body Location</option> <option value="S">Evaluation</option> <option value="S">Feature</option> <option value="S">Period</option> <option value="0">Primary Location</option> <option value="0">Repetition</option> <option value="0">Season</option> <option value="S">Sensation</option> <option value="0">Shave</option> <option value="S">Site</option> <option value="S">Skin Type</option> <option value="0">Subject</option> <option value="0">Tan</option> </select></P> a select posts back the selected value, not the index, so in your case it
eithe '0' or 'S', wich always matches one of the first two selections. you need unique values for each selection. -- bruce (sqlwork.com) Show quoteHide quote "oaksong" <oaks***@hotmail.com> wrote in message news:1130876186.991530.239980@g44g2000cwa.googlegroups.com... > I've got a data combo with about 12 rows, of which only the first two > are selectable! > > I put a label on the page below the datacombo and selecteditem.text > will populate the list when I change the selection combo for either of > the first two items, but not for any of the others. > > I'm using database objects to populate the Datacombo. > > The code is: > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles MyBase.Load > 'Put user code to initialize the page here > > If Not IsPostBack Then > odaParam.Fill(DsParam2) > cmbParam.DataBind() > End If > > > End Sub > > Private Sub cmbParam_SelectedIndexChanged(ByVal sender As > System.Object, ByVal e As System.EventArgs) Handles > cmbParam.SelectedIndexChanged > > Label1.Text = cmbParam.SelectedItem.Text > > End Sub > > The HTML is: > <P> > <select name="cmbParam" onchange="__doPostBack('cmbParam','')" > language="javascript" id="cmbParam"> > <option value="0"> Select..</option> > <option value="S">Body Location</option> > <option value="S">Evaluation</option> > <option value="S">Feature</option> > <option value="S">Period</option> > <option value="0">Primary Location</option> > <option value="0">Repetition</option> > <option value="0">Season</option> > <option value="S">Sensation</option> > <option value="0">Shave</option> > <option value="S">Site</option> > <option value="S">Skin Type</option> > <option value="0">Subject</option> > <option value="0">Tan</option> > > </select></P> >
Other interesting topics
Threads sharing objects in memory during high volume use
How can I stop ASPX file rendering in Page_Load event? server.transfer Making an Excel File Upload if files from client PC or local network Code reuse, code behind, and can't inherit since already inherits Page Finding a control strange string added to all project's URLs when running on localhost VS2005 - unable to create a website in IIS progrss bar that shows that status of processes |
|||||||||||||||||||||||