Subject: DropDownList not firing
Posted By: pbyrum Post Date: 10/7/2004 7:55:57 PM
I am using ASP C# on a web page and have an ASP dropdown list control. When select and change a different value in the dropdown list, my event is not firing.

I have used:

OnSelectedIndexChanged="ddlRoom_SelectedIndexChanged"

in the ASPX page and this work, however I get a memory exception error when I close IE.

I have also tried:

this.ddlRoom.SelectedIndexChanged += new System.EventHandler(ddlRoom_SelectedIndexChanged);

private void ddlRoom_SelectedIndexChanged(object sender, System.EventArgs e)

but this is not firing.  What is the proper way of programming an event for a dropdown list?

Thanks,

Paul

Reply By: mahulda Reply Date: 10/8/2004 1:46:02 AM
1.  In the tag of the dropdownlist put Autopostback = "true" OnSelectedIndexChanged = "ddlRoom_SelectedIndexChanged"

2.  Make sure you have the event handler subroutine (ddlRoom_SelectedIndexChanged) declared in your code

-.. -..
Reply By: xiaozhou Reply Date: 10/8/2004 3:10:29 AM
I am a new learner ,i don't know how to study ,can you help me ?

Reply By: stu9820 Reply Date: 10/8/2004 7:13:32 AM
What do you need help with?

Reply By: pbyrum Reply Date: 10/8/2004 2:42:47 PM
I have the following in the .cs file:

this.ddlRoom.SelectedIndexChanged += new System.EventHandler(ddlRoom_SelectedIndexChanged);

private void ddlRoom_SelectedIndexChanged(object sender, System.EventArgs e)
{
}

In my .ASPX file, in have:

<asp:dropdownlist id="ddlRoom" runat="server" AutoPostBack="True">

Note that I do not have the OnSelectedIndexChanged in the tag, and the method is private. This works. I am not sure why but it works.

Howevwer, I get and MS IE application error when I close IE and end the debug session in MS Visual Studio. This error only occurs when I select the dropdown list box and the event is fired.

iexplorer.exe - Application Error. The instruction at "0x10003e8d" referenced memory at "0x10003e8d". The memory could not be "read"

What could be going on?

Thanks,

Paul
Reply By: bmains Reply Date: 10/8/2004 5:31:11 PM
You don't need the event in the tag.  That looks right to me...  The memory reference error may have nothing to do with your app; it may be an error with the browser.  I get those sometimes.

Brian
Reply By: pbyrum Reply Date: 10/11/2004 11:39:45 AM
Thanks for your help.  It appears there is something going on behind the seens with MS IE, but I think the code is working to some agree.

Paul
Reply By: bmains Reply Date: 10/12/2004 11:58:37 AM
Happens every now and then.  It helps to have the most current browser also, even though that shouldn't be an issue.

Brian

Go to topic 20550

Return to index page 747
Return to index page 746
Return to index page 745
Return to index page 744
Return to index page 743
Return to index page 742
Return to index page 741
Return to index page 740
Return to index page 739
Return to index page 738