On Selection Changed not Triggered

The event prodedure is skipped.


aspx form:
<asp:DropDownList runat="server" DataValueField="ChapterID"
            DataTextField="ChapterName" Height="25px" Width="209px"
            DataSourceID="dscChapters" ID="ddlChapters"
            OnSelectionChanged="ddlChaptersSelected_Click">
    </asp:DropDownList>

aspx.cs :
set this line to halt processing.
Processing does not pause.
I set debug mode to true.
 protected void ddlChaptersSelected_Click(object sender, EventArgs e)
        {
            string mystring = "abc";
        }

Page_Load halts.
 protected void Page_Load(object sender, EventArgs e)
        {

        }

What am I missing?

Thanks,



DovbermanAsked:
Who is Participating?
 
DovbermanConnect With a Mentor Author Commented:
Should be OnSelectedIndexChanged="ddlChaptersSelected_Click"

Not OnSelectionChanged="ddlChaptersSelected_Click"

Thanks anyway.
0
 
strickddCommented:
AutoPostBack="true"
0
 
DovbermanAuthor Commented:
I resolved it myself.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
owaisyahyaCommented:
There is no event like "OnSelectionChanged" in asp.net for drop down lists, it should be OnSelectionChanged, and it will not work untill you specify autopostback value to true.

        <asp:DropDownList runat="server" DataValueField="ChapterID"
            DataTextField="ChapterName" Height="25px" Width="209px"
            DataSourceID="dscChapters" ID="ddlChapters" OnSelectedIndexChanged="ddlChapters_SelectedIndexChanged" AutoPostBack="true">
        </asp:DropDownList>


    protected void ddlChapters_SelectedIndexChanged(object sender, EventArgs e)
    {

    }

Open in new window

0
 
strickddCommented:
Regardless, what is missing is what I orignally posted:

AutoPostBack="true"
0
 
DovbermanAuthor Commented:
strickdd:

I also found out about AutoPostBack myself.

I corrected the method statement myself.

If you really need the points that badly, you can have them.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.