none
can the drop down list doing it by wihout submit button ? RRS feed

  • General discussion

  • can the drop down list doing it by wihout submit button ? 

    in vb.net ....

    tq!

    Wednesday, October 26, 2011 2:30 PM

All replies

  • If I understand correctly, you might want a postback on item change.

    You can set Autopostback property to true and add a SelectedIndexChanged handler.

    <asp:DropDownList ID="DropDownList1" 
    runat="server" 
    AutoPostBack="true" 
    OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> 
    <asp:ListItem>HyperLink</asp:ListItem> 
    <asp:ListItem>PasswordRecovery</asp:ListItem> 
    <asp:ListItem>PlaceHolder</asp:ListItem> 
    <asp:ListItem>LoginName</asp:ListItem> 
    <asp:ListItem>Label</asp:ListItem> 
    </asp:DropDownList>
    


    As for VB.NET handler you can use the code below in your page

    Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
    'Some code here
    End Sub
    
    


    Hope this is what you were looking for.

    Wednesday, October 26, 2011 2:42 PM