zeeshansmughal Posted July 3, 2006 Share Posted July 3, 2006 i want to filter listbox2 by selecting values from listbox1.asp.net with c#.net or with vb.net Link to comment Share on other sites More sharing options...
pulpfiction Posted July 3, 2006 Share Posted July 3, 2006 This might help,http://www.velocityreviews.com/forums/t104...er-listbox.htmlhttp://www.societopia.net/samples/dynamicc..._viewstate.aspx Link to comment Share on other sites More sharing options...
zeeshansmughal Posted July 4, 2006 Author Share Posted July 4, 2006 This might help,http://www.velocityreviews.com/forums/t104...er-listbox.htmlhttp://www.societopia.net/samples/dynamicc..._viewstate.aspx<{POST_SNAPBACK}> its nice but not give the complete solution, becouse i join the ms access file with two listboxs and using on change event an other command which is "select coloum_name from table_name where field_name =" & listbox.selectedIndexbut gives an error of missing '.' operator. Link to comment Share on other sites More sharing options...
pulpfiction Posted July 4, 2006 Share Posted July 4, 2006 "listbox.selectedIndex.value" gives the value that was selectedtry this select coloum_name from table_name where field_name =" & listbox.selectedIndex.value Link to comment Share on other sites More sharing options...
zeeshansmughal Posted July 5, 2006 Author Share Posted July 5, 2006 "listbox.selectedIndex.value" gives the value that was selectedtry this select coloum_name from table_name where field_name =" & listbox.selectedIndex.value<{POST_SNAPBACK}> "listbox.selectedIndex.value" gives the value that was selected : incorrect,not exist"listbox.selecteditem.value"i used listbox.selectedValue it gives the following error:Syntax error (missing operator) in query expression 'field_name = first_value'. note: . operator at the end, it is expecting . between string and the valueit gives only first value from the listbox1, either i select the other valueit gives indication at execute command Link to comment Share on other sites More sharing options...
pulpfiction Posted July 5, 2006 Share Posted July 5, 2006 I guess the problem is with postback... do this <asp:ListBox Runat="server" ID="listbox" AutoPostBack=True>then try this, [seems to be working fine to me]Dim sql As String = "select column_name from table_name where field_name = " & listbox.SelectedValue Link to comment Share on other sites More sharing options...
zeeshansmughal Posted July 6, 2006 Author Share Posted July 6, 2006 I guess the problem is with postback... do this <asp:ListBox Runat="server" ID="listbox" AutoPostBack=True>then try this, [seems to be working fine to me]Dim sql As String = "select column_name from table_name where field_name = " & listbox.SelectedValue<{POST_SNAPBACK}> <asp:DropDownList id="one" style="Z-INDEX: 101; LEFT: 256px; POSITION: absolute; TOP: 72px" runat="server" AutoPostBack="True"></asp:DropDownList>That is copied from the code. With this property it's not working.is there other way, means asp code or java script code Link to comment Share on other sites More sharing options...
zeeshansmughal Posted March 14, 2007 Author Share Posted March 14, 2007 Hello again!i did (filter 2nd drop down from fist) it for the two dropdown but i want it for multiple dropdown.i use :page load if not page.ispostback then//bind firstend if on selected item change of firstbind 2ndcan any body help me? Link to comment Share on other sites More sharing options...
pulpfiction Posted March 14, 2007 Share Posted March 14, 2007 It should work similarly, for multiple dropdowns.... on selected item change of firstbind 2ndon selected item change of secondbind 3rdwhere is that you are having problem?? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now