Dropdownlist onselectedIndexChanged event not fires

Discussion in 'ASP .Net' started by Alexander Reichman, Oct 17, 2004.

  1. Hi All,



    I have 22 years of over all experience in programming but just recently
    started to learn WEB applications, and started to write my first application
    in ASP.NET(VB)

    using VISUAL Studio .NET 2003



    I have a DropDownList on a Web Form in WEB user control.

    SelectedIndexChanged event is not and it does not call
    DropColors_SelectedIndexChanged subroutine. (Tested in Debug mode)



    Here is an excerpt from qjobsearch.ascx (I have created this DropDownList
    only for test)



    <%@ Control Language="vb" AutoEventWireup="false"
    Codebehind="qjobsearch.ascx.vb" Inherits="MyJobSite.qjobsearch"
    TargetSchema="http://schemas.microsoft.com/intellisense/ie5" debug="True"
    enableViewState="True" warningLevel="1"%>

    <tr>

    <td width="100%" bgcolor="#ff9933" style="BORDER-RIGHT:

    medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none;
    BORDER-BOTTOM: medium none">

    <p style="MARGIN-LEFT: 4px"><font
    color="#ffffff"><b>Title Quick Job search</b></font></p>

    </td>

    </tr>

    <tr>

    ..

    ..

    <form id="Form2" runat="server">

    <p align="left" style="MARGIN: 4px 6px"></p>

    <asp:DropDownList ID="dropColors"
    OnSelectedIndexChanged="dropColors_SelectedIndexChanged" Runat="Server"


    Width="88px" AutoPostBack="true" >


    <asp:listitem value="Red">Red</asp:listitem>


    <asp:listitem value="Green">Green</asp:listitem>


    <asp:listitem value="Blue">Blue</asp:listitem>

    </asp:DropDownList>



    ..

    </FORM>



    I have created another form which contains only this control and it works

    May be there are some restrictions to use this control in ASCX files and
    under some HTML tags.

    Also may be you know some methods to trace the raised events.



    Any help will be much appreciated.



    Thanks.



    Alex.
    Alexander Reichman, Oct 17, 2004
    #1
    1. Advertising

  2. Alexander Reichman

    David Wier Guest

    Try adding (to the DDL tag):
    AutoPostback="True"


    David Wier
    MCP, MVP ASP.NET, ASPInsider
    http://aspnet101.com
    http://aspexpress.com


    "Alexander Reichman" <> wrote in message
    news:DsAcd.5977$...
    > Hi All,
    >
    >
    >
    > I have 22 years of over all experience in programming but just recently
    > started to learn WEB applications, and started to write my first

    application
    > in ASP.NET(VB)
    >
    > using VISUAL Studio .NET 2003
    >
    >
    >
    > I have a DropDownList on a Web Form in WEB user control.
    >
    > SelectedIndexChanged event is not and it does not call
    > DropColors_SelectedIndexChanged subroutine. (Tested in Debug mode)
    >
    >
    >
    > Here is an excerpt from qjobsearch.ascx (I have created this DropDownList
    > only for test)
    >
    >
    >
    > <%@ Control Language="vb" AutoEventWireup="false"
    > Codebehind="qjobsearch.ascx.vb" Inherits="MyJobSite.qjobsearch"
    > TargetSchema="http://schemas.microsoft.com/intellisense/ie5" debug="True"
    > enableViewState="True" warningLevel="1"%>
    >
    > <tr>
    >
    > <td width="100%" bgcolor="#ff9933" style="BORDER-RIGHT:
    >
    > medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none;
    > BORDER-BOTTOM: medium none">
    >
    > <p style="MARGIN-LEFT: 4px"><font
    > color="#ffffff"><b>Title Quick Job search</b></font></p>
    >
    > </td>
    >
    > </tr>
    >
    > <tr>
    >
    > .
    >
    > .
    >
    > <form id="Form2" runat="server">
    >
    > <p align="left" style="MARGIN: 4px 6px"></p>
    >
    > <asp:DropDownList ID="dropColors"
    > OnSelectedIndexChanged="dropColors_SelectedIndexChanged" Runat="Server"
    >
    >
    > Width="88px" AutoPostBack="true" >
    >
    >
    > <asp:listitem value="Red">Red</asp:listitem>
    >
    >
    > <asp:listitem value="Green">Green</asp:listitem>
    >
    >
    > <asp:listitem value="Blue">Blue</asp:listitem>
    >
    > </asp:DropDownList>
    >
    >
    >
    > .
    >
    > </FORM>
    >
    >
    >
    > I have created another form which contains only this control and it works
    >
    > May be there are some restrictions to use this control in ASCX files and
    > under some HTML tags.
    >
    > Also may be you know some methods to trace the raised events.
    >
    >
    >
    > Any help will be much appreciated.
    >
    >
    >
    > Thanks.
    >
    >
    >
    > Alex.
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    David Wier, Oct 18, 2004
    #2
    1. Advertising

  3. Alexander Reichman, Oct 24, 2004
    #3
  4. Alexander Reichman

    mxia

    Joined:
    May 19, 2006
    Messages:
    2
    Adding AutoPostback="True" to the ddl tag solved my problem, thanks!
    mxia, Dec 1, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul L
    Replies:
    1
    Views:
    7,271
  2. Replies:
    8
    Views:
    749
  3. Paul L
    Replies:
    0
    Views:
    238
    Paul L
    May 5, 2005
  4. Replies:
    3
    Views:
    978
  5. Alexander Reichman

    Dropdownlist onselectedIndexChanged event not fires

    Alexander Reichman, Oct 17, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    185
Loading...

Share This Page