468,554 Members | 1,884 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,554 developers. It's quick & easy.

Dropdownlist.selectedIndexchanged


Why doesn't the the SelectedIndexchanged event for my dropdownlist ever get
executed? Why do I get a page not found error when I select a new item?

My dropdownlist is within a form. The items for the dropdownlist are added
at form load by a procedure. Autopostback is set to true, and viewstate is
enabled. I have placed a stop at the first line of code for the
SelectedIndexChanged event and I have determined that the code is not
executed.
Oct 9 '06 #1
5 2359
Can you post some sample of the code, specifically the HTML used to render
the dropdownlist and also the form tag? Check to see that your form tag is
properly formed. I've seen sometimes where instead of <form runat="server">
someone will accidentally write <form action="server">, which would result
in the form posting to an incorrect source.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Victorious1" <Vi*********@discussions.microsoft.comwrote in message
news:8B**********************************@microsof t.com...
>
Why doesn't the the SelectedIndexchanged event for my dropdownlist ever
get
executed? Why do I get a page not found error when I select a new item?

My dropdownlist is within a form. The items for the dropdownlist are
added
at form load by a procedure. Autopostback is set to true, and viewstate
is
enabled. I have placed a stop at the first line of code for the
SelectedIndexChanged event and I have determined that the code is not
executed.

Oct 9 '06 #2
Sometimes the ide fails to wire up the event handlers (i have experienced it
many times ..and had to manually wire up the evnt handlers in the
initializecomponent()
do take a look at that methos and chk if ur event handler is wired up..
Cheers ..Gauri

"Victorious1" wrote:
>
Why doesn't the the SelectedIndexchanged event for my dropdownlist ever get
executed? Why do I get a page not found error when I select a new item?

My dropdownlist is within a form. The items for the dropdownlist are added
at form load by a procedure. Autopostback is set to true, and viewstate is
enabled. I have placed a stop at the first line of code for the
SelectedIndexChanged event and I have determined that the code is not
executed.
Oct 10 '06 #3
This is the code block for the form:

<body MS_POSITIONING="GridLayout">
<FORM id="Form1" method="post" runat="server">
<asp:hyperlink id="HyperLink2" style="Z-INDEX: 101; LEFT: 304px;
POSITION: absolute; TOP: 16px"
Height="24px" Width="360px" Font-Names="Arial" runat="server"
ToolTip="Maybe you chose the wrong form?"
NavigateUrl="WebEntry.aspx">Return to form selection and choose
different form.</asp:hyperlink>
<asp:datagrid id="PetDataGrid" style="Z-INDEX: 105; LEFT: 32px; POSITION:
absolute; TOP: 488px"
ForeColor="Blue" Font-Size="Medium" Height="218px" Width="1024px"
Font-Names="Arial" runat="server"
AutoGenerateColumns="False" CellPadding="10">
<ItemStyle Font-Size="Smaller" Font-Names="Arial"
ForeColor="#0000CC"></ItemStyle>
<HeaderStyle Font-Size="Medium" Font-Names="Arial Unicode MS"
Font-Bold="True" ForeColor="Blue"
BackColor="#FFFF99"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="lastname" HeaderText="Last
Name"></asp:BoundColumn>
<asp:BoundColumn DataField="firstname" HeaderText="First
Name"></asp:BoundColumn>
<asp:BoundColumn DataField="study_name" HeaderText="Study
Name"></asp:BoundColumn>
<asp:BoundColumn DataField="visit_number" HeaderText="Visit
Number"></asp:BoundColumn>
<asp:BoundColumn DataField="visit_date" HeaderText="Visit Date"
DataFormatString="{0:M/d/yyyy}"></asp:BoundColumn>
<asp:BoundColumn DataField="scandate" HeaderText="Scan Date"
DataFormatString="{0:M/d/yyyy}"></asp:BoundColumn>
<asp:BoundColumn DataField="Status"
HeaderText="Status"></asp:BoundColumn>
<asp:BoundColumn DataField="scanner"
HeaderText="Scanner"></asp:BoundColumn>
<asp:BoundColumn DataField="patient_number"
HeaderText="Patient#"></asp:BoundColumn>
<asp:BoundColumn DataField="Agent" HeaderText="Contrast
Agent"></asp:BoundColumn>
<asp:BoundColumn DataField="Task" HeaderText="Task"></asp:BoundColumn>
<asp:BoundColumn DataField="glucose_use" HeaderText="Glucose
Use"></asp:BoundColumn>
<asp:BoundColumn DataField="Blank" HeaderText="Blank"></asp:BoundColumn>
<asp:BoundColumn DataField="diagnosis"
HeaderText="Diagnosis"></asp:BoundColumn>
<asp:BoundColumn DataField="dob" HeaderText="Birth
Date"></asp:BoundColumn>
<asp:BoundColumn DataField="Gender"
HeaderText="Gender"></asp:BoundColumn>
<asp:BoundColumn DataField="Race" HeaderText="Race"></asp:BoundColumn>
<asp:BoundColumn DataField="Ethnicity"
HeaderText="Ethnicity"></asp:BoundColumn>
<asp:BoundColumn DataField="emission1"
HeaderText="emission1"></asp:BoundColumn>
<asp:BoundColumn DataField="emission2"
HeaderText="emission2"></asp:BoundColumn>
<asp:BoundColumn DataField="transmission1" HeaderText="Transmission
1"></asp:BoundColumn>
<asp:BoundColumn DataField="transmission2" HeaderText="Transmission
2"></asp:BoundColumn>
<asp:BoundColumn DataField="Comments"
HeaderText="Comments"></asp:BoundColumn>
<asp:BoundColumn DataField="referal"
HeaderText="Referal"></asp:BoundColumn>
<asp:BoundColumn DataField="REPORTDATE" HeaderText="Report Date"
DataFormatString="{0:M/d/yyyy}"></asp:BoundColumn>
<asp:BoundColumn DataField="Recon_date"
HeaderText="Reconstruction_date"
DataFormatString="{0:M/d/yyyy}"></asp:BoundColumn>
<asp:BoundColumn DataField="image_date" HeaderText="image_date"
DataFormatString="{0:M/d/yyyy}"></asp:BoundColumn>
<asp:BoundColumn DataField="send_date" HeaderText="Send Date"
DataFormatString="{0:M/d/yyyy}"></asp:BoundColumn>
</Columns>
</asp:datagrid><asp:button id="ButtonLogOff" style="Z-INDEX: 104; LEFT:
440px; POSITION: absolute; TOP: 48px"
ForeColor="Blue" Height="24px" Width="104px" runat="server" Text="Log
Off" BorderStyle="None" Font-Bold="True"
BackColor="White"></asp:button>
<TABLE id="Table1" style="Z-INDEX: 103; LEFT: 32px; WIDTH: 1200px;
POSITION: absolute; TOP: 72px; HEIGHT: 376px"
height="376" cellSpacing="2" cellPadding="2" width="1200" border="0">
<TR>
<TD style="WIDTH: 845px; HEIGHT: 18px" colSpan="5"><asp:label
id="StatusLabel" ForeColor="#0000C0" Font-Size="Larger" Height="48px"
Width="920px"
Font-Names="Arial Rounded MT Bold"
runat="server">Label</asp:label></TD>
</TR>
<TR>
<TD style="WIDTH: 211px; HEIGHT: 77px">
<DIV align="left">
<DIV align="left"><asp:label id="Label1" ForeColor="Navy"
Font-Size="Larger" Height="32px" Width="168px" Font-Names="Arial Rounded MT
Bold"
runat="server">Start Date (mm/dd/yyyy)</asp:label>
<DIV align="left"><asp:textbox id="TextBoxStart" Height="32px"
Width="200px" runat="server"></asp:textbox></DIV>
</DIV>
</DIV>
</TD>
<TD style="WIDTH: 287px; HEIGHT: 77px">
<DIV align="left">
<DIV align="left">
<DIV align="left"><asp:label id="InstructionLabel" ForeColor="Navy"
Font-Size="Larger" Height="32px" Width="160px"
Font-Names="Arial Rounded MT Bold" runat="server">End Date
(mm/dd/yyyy)</asp:label><asp:textbox id="TextBoxEnd" Height="32px"
Width="169px" runat="server"></asp:textbox></DIV>
</DIV>
</DIV>
</TD>
<TD style="WIDTH: 327px; HEIGHT: 77px">
<DIV align="center"></DIV>
</TD>
<TD style="WIDTH: 102px; HEIGHT: 77px">
<DIV align="center">
<DIV align="center"</DIV>
</DIV>
</TD>
<TD style="HEIGHT: 77px">
<DIV align="center"</DIV>
</TD>
</TR>
<TR>
<TD style="WIDTH: 211px; HEIGHT: 82px">
<DIV align="left">
<DIV align="left"><asp:label id="LabelSelectStudies"
ForeColor="#0000C0" Font-Size="Larger" Height="48px" Width="162px"
Font-Names="Arial Rounded MT Bold" runat="server"Study</asp:label>
<DIV align="center"><asp:dropdownlist id="DropDownListStudies"
tabIndex="1" Height="40px" Width="267px" runat="server"
AutoPostBack="True"></asp:dropdownlist></DIV>
</DIV>
</DIV>
</TD>
<TD style="WIDTH: 287px; HEIGHT: 82px">
<DIV align="left">
<DIV align="left"><asp:label id="LabelGroup" ForeColor="Navy"
Font-Size="Larger" Height="32px" Width="240px"
Font-Names="Arial Rounded MT Bold" runat="server"
Visible="False">Group</asp:label><asp:dropdownlist id="DropDownListGroup"
Height="32px" Width="256px" runat="server"
Visible="False"></asp:dropdownlist></DIV>
</DIV>
</TD>
<TD style="WIDTH: 327px; HEIGHT: 82px">
<DIV align="left">
<DIV align="left"><asp:label id="Label3" ForeColor="Navy"
Font-Size="Larger" Height="32px" Width="240px" Font-Names="Arial Rounded MT
Bold"
runat="server">Diagnosis</asp:label><asp:dropdownlist
id="DropDownListDiagnosis" Height="16px" Width="333px"
runat="server"></asp:dropdownlist></DIV>
</DIV>
</TD>
<TD style="WIDTH: 102px; HEIGHT: 82px">
<DIV align="left">
<DIV align="left"</DIV>
</DIV>
</TD>
<td style="WIDTH: 500px; HEIGHT: 82px"></td>
</TR>
<TR>
<TD style="WIDTH: 211px; HEIGHT: 53px"></TD>
<TD style="WIDTH: 287px; HEIGHT: 53px"></TD>
<TD style="WIDTH: 327px; HEIGHT: 53px"></TD>
<TD style="WIDTH: 102px; HEIGHT: 53px">
<DIV align="center"><asp:imagebutton id="ImageButtonFindStudy"
Height="40px" Width="95px" runat="server"
ImageUrl="Find-Button.gif"></asp:imagebutton></DIV>
</TD>
<TD style="WIDTH: 500px">
<DIV align="center"</DIV>
</TD>
</TR>
</TABLE>
</FORM>

"Mark Fitzpatrick" wrote:
Can you post some sample of the code, specifically the HTML used to render
the dropdownlist and also the form tag? Check to see that your form tag is
properly formed. I've seen sometimes where instead of <form runat="server">
someone will accidentally write <form action="server">, which would result
in the form posting to an incorrect source.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Victorious1" <Vi*********@discussions.microsoft.comwrote in message
news:8B**********************************@microsof t.com...

Why doesn't the the SelectedIndexchanged event for my dropdownlist ever
get
executed? Why do I get a page not found error when I select a new item?

My dropdownlist is within a form. The items for the dropdownlist are
added
at form load by a procedure. Autopostback is set to true, and viewstate
is
enabled. I have placed a stop at the first line of code for the
SelectedIndexChanged event and I have determined that the code is not
executed.


Oct 10 '06 #4
This is the HTML reduced to the relevant sections:

<form id="Form1" method="post" runat="server">
<TABLE id="Table1" style="Z-INDEX: 103; LEFT: 8px; WIDTH: 1200px; POSITION:
absolute; TOP: 8px; HEIGHT: 376px"
height="376" cellSpacing="2" cellPadding="2" width="1200" border="0">
<TR>
<TD style="WIDTH: 211px; HEIGHT: 82px">
<asp:label id="LabelSelectStudies" runat="server" Font-Names="Arial
Rounded MT Bold" Width="162px"
Height="48px" Font-Size="Larger" ForeColor="#0000C0"Study</asp:label>
<DIV align="center">
asp:dropdownlist id="DropDownListStudies" tabIndex="1" runat="server"
Width="267px" Height="40px"
AutoPostBack="True"></asp:dropdownlist></DIV>
</DIV>
</DIV>
</TD>

</form>

"Mark Fitzpatrick" wrote:
Can you post some sample of the code, specifically the HTML used to render
the dropdownlist and also the form tag? Check to see that your form tag is
properly formed. I've seen sometimes where instead of <form runat="server">
someone will accidentally write <form action="server">, which would result
in the form posting to an incorrect source.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Victorious1" <Vi*********@discussions.microsoft.comwrote in message
news:8B**********************************@microsof t.com...

Why doesn't the the SelectedIndexchanged event for my dropdownlist ever
get
executed? Why do I get a page not found error when I select a new item?

My dropdownlist is within a form. The items for the dropdownlist are
added
at form load by a procedure. Autopostback is set to true, and viewstate
is
enabled. I have placed a stop at the first line of code for the
SelectedIndexChanged event and I have determined that the code is not
executed.


Oct 10 '06 #5
Thanks for the input. As it turns out the page had expired. When the page
loads a large dataset is loaded into the datagrid. The data is returned
visually but after the page expires. (Hmmm! Curious?) When I modified the SQL
to load less data I found that the page loaded quicker and subsequent on
change events after the page loaded occurred without fail. It seems I need
to learn more about managing the session parameters.

"Victorious1" wrote:
>
Why doesn't the the SelectedIndexchanged event for my dropdownlist ever get
executed? Why do I get a page not found error when I select a new item?

My dropdownlist is within a form. The items for the dropdownlist are added
at form load by a procedure. Autopostback is set to true, and viewstate is
enabled. I have placed a stop at the first line of code for the
SelectedIndexChanged event and I have determined that the code is not
executed.
Oct 11 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Shiju Poyilil | last post: by
1 post views Thread by sergeyr3 | last post: by
4 posts views Thread by David | last post: by
11 posts views Thread by Santosh | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.