Do you mean when a user enters something in a textbox and hits a button, you
want to have a value in a listbox selected? If so, then it's pretty easy.
<asp:textbox id="txt" runat="Server" /> <asp:button id="btn"
runat="server" Text="Go!" /><br /><br />
<asp:dropdownli st id="ddl" runat="Server">
<asp:ListItem Value="1">Canad a</asp:ListItem>
<asp:ListItem Value="2">Unite d States</asp:ListItem>
<asp:ListItem Value="3">Mexic o</asp:ListItem>
</asp:dropdownlis t>
And your codebehind could look something like:
Protected WithEvents btn As System.Web.UI.W ebControls.Butt on
Protected txt As System.Web.UI.W ebControls.Text Box
Protected ddl As System.Web.UI.W ebControls.Drop DownList
Private Sub btn_Click(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btn.Click
Dim textboxValue As String = txt.Text
ddl.SelectedInd ex =
ddl.Items.Index Of(ddl.Items.Fi ndByValue(textb oxValue))
End Sub
this is obviously a simple example.
Karl
"RockNRoll" <da*******@yaho o.com> wrote in message
news:Od******** *****@TK2MSFTNG P12.phx.gbl...
Greetings,
Can I select an item in a listbox based on user textbox entry and a submit
button? Can you provide any code examples for what needs to occur when
the user clicks submit? Thank you,
-Dave