473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SelectedIndexChanged event does not fire?

Jim
Hi All,

Can someone tell me why the SelectedIndexChanged event does not fire?

<form id="Form1" method="post" runat="server">

<asp:Table id="Table1" runat="server" Width="455px" Height="61px">

<asp:TableRow>

<asp:TableCell>

<asp:DropDownList id="DropDownList1" runat="server" Width="263px"
AutoPostBack="True">

<asp:ListItem Value="bef">bef</asp:ListItem>

<asp:ListItem Value="kut">kut</asp:ListItem>

</asp:DropDownList>

</asp:TableCell>

</asp:TableRow>

</asp:Table>

</form>


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

{

Response.Write("it works!"); //no way!!

}

ch Jim
Nov 19 '05 #1
3 1624
Where is the evnet hooked?
Since you aren't explicitely showing it and your method is private, make
sure this.DropDownList1.SelectedIndexChange +=
this.DropDownList1_SelectedIndexChanged; is in the onInit

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Jim" <ji*******@hotmail.com> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
Hi All,

Can someone tell me why the SelectedIndexChanged event does not fire?

<form id="Form1" method="post" runat="server">

<asp:Table id="Table1" runat="server" Width="455px" Height="61px">

<asp:TableRow>

<asp:TableCell>

<asp:DropDownList id="DropDownList1" runat="server" Width="263px"
AutoPostBack="True">

<asp:ListItem Value="bef">bef</asp:ListItem>

<asp:ListItem Value="kut">kut</asp:ListItem>

</asp:DropDownList>

</asp:TableCell>

</asp:TableRow>

</asp:Table>

</form>


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

{

Response.Write("it works!"); //no way!!

}

ch Jim

Nov 19 '05 #2
In your code behind, is the DropDownList1_SelectedIndexChanged method
assigned to DropDownList1's IndexChanged event? It needs to be either in the
code behind or in the ASPX page

--
------------------------------------------
Damon Payne
http://www.damonpayne.com
"Jim" <ji*******@hotmail.com> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
Hi All,

Can someone tell me why the SelectedIndexChanged event does not fire?

<form id="Form1" method="post" runat="server">

<asp:Table id="Table1" runat="server" Width="455px" Height="61px">

<asp:TableRow>

<asp:TableCell>

<asp:DropDownList id="DropDownList1" runat="server" Width="263px"
AutoPostBack="True">

<asp:ListItem Value="bef">bef</asp:ListItem>

<asp:ListItem Value="kut">kut</asp:ListItem>

</asp:DropDownList>

</asp:TableCell>

</asp:TableRow>

</asp:Table>

</form>


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

{

Response.Write("it works!"); //no way!!

}

ch Jim

Nov 19 '05 #3
Jim
thanks Carl and Damon for the solution!

ch Jim
"Damon Payne" <da***@damonpayne.com> schreef in bericht
news:XY*******************@twister.rdc-kc.rr.com...
In your code behind, is the DropDownList1_SelectedIndexChanged method
assigned to DropDownList1's IndexChanged event? It needs to be either in
the
code behind or in the ASPX page

--
------------------------------------------
Damon Payne
http://www.damonpayne.com
"Jim" <ji*******@hotmail.com> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
Hi All,

Can someone tell me why the SelectedIndexChanged event does not fire?

<form id="Form1" method="post" runat="server">

<asp:Table id="Table1" runat="server" Width="455px" Height="61px">

<asp:TableRow>

<asp:TableCell>

<asp:DropDownList id="DropDownList1" runat="server" Width="263px"
AutoPostBack="True">

<asp:ListItem Value="bef">bef</asp:ListItem>

<asp:ListItem Value="kut">kut</asp:ListItem>

</asp:DropDownList>

</asp:TableCell>

</asp:TableRow>

</asp:Table>

</form>


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

{

Response.Write("it works!"); //no way!!

}

ch Jim


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PeacError | last post by:
Using Microsoft Visual Studio .NET 2003, Visual C# .NET 1.1: I apologize if this question has been addressed elsewhere, but I could not find a reference to it in the search engine for this...
1
by: Edward | last post by:
I am having a terrible time getting anything useful out of a listbox on my web form. I am populating it with the results from Postcode lookup software, and it is showing the results fine. What...
0
by: tafpin | last post by:
I have an application with a datagrid. In the IDE I have 2 template columns. The first has an image button and the second contains a link button. According to the results that I get back I must...
3
by: Alec MacLean | last post by:
Hi, I have a couple of win forms where I am editing values that are stored in a SQL database. I'm using the listbox control to hold the data object each form interacts with. Each object is...
4
by: lakepeir | last post by:
Hello, I have combobox with a selectedindexchanged method that seems to be called when starting the application, launching the form with the combobox and making a change in the drop down box of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.