Yes - it is wired correctly - if the ONLY thing I change is EnableViewState
for the listbox, then this makes the difference.
The items in the listbox are added using Items.Add in VB. I have simplified
the page to its bare minimum (see below) and it still demostrates this
bahavior.
I checked the js it generates and it is correctly
"onchange="__doPostBack('LstDatesCourts','')" . From within Page_load I
checked Request.form("__EventTarget") and it was correctly "LstDatesCourts".
Thanks for any info, I'm stumped.
Paul.
--------------
Public Class ChooseReservationGroupEditTESTT
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Protected WithEvents LstDatesCourts As System.Web.UI.WebControls.ListBox
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
ShowList()
End If
End Sub
Sub ShowList()
Dim n As Integer
For n = 1 To 6
LstDatesCourts.Items.Add(n.ToString())
LstDatesCourts.Items(LstDatesCourts.Items.Count - 1).Value =
n.ToString
Next
End Sub
Private Sub LstDatesCourts_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles LstDatesCourts.SelectedIndexChanged
Response.Write("Event was fired")
End Sub
End Class
---------------------------------
Imports System.Data.SqlClient
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="ChooseReservationGroupEditTESTT.aspx.vb"
Inherits="ScheduleA.ChooseReservationGroupEditTESTT" enableViewState="True"
EnableSessionState="False"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>ChooseReservationGroupEdit</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="
http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<script language="javascript">
<!--
//-->
</script>
</HEAD>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="439" border="1"
style="WIDTH: 439px; HEIGHT: 440px"
class="body2" align="center">
<TR>
<TD style="HEIGHT: 64px">
<DIV id="Label1" style="DISPLAY: inline; WIDTH: 408px; HEIGHT: 33px"
runat="server" ms_positioning="FlowLayout"
class="body1">Label</DIV>
</TD>
</TR>
<TR>
<TD style="HEIGHT: 231px">
<P align="center">
<asp:listbox id="LstDatesCourts" runat="server" Width="383px"
Height="200px" AutoPostBack="True"></asp:listbox></P>
</TD>
</TR>
<TR>
<TD style="HEIGHT: 65px">Do you want to edit:
<TABLE id="Table2" style="WIDTH: 424px; HEIGHT: 32px" cellSpacing="1"
cellPadding="1" width="424"
border="0">
</TABLE>
</TD>
</TR>
<TR>
<TD align="left" style="HEIGHT: 70px">
<DIV style="DISPLAY: inline; WIDTH: 424px; FONT-STYLE: italic; HEIGHT:
19px; TEXT-ALIGN: center"
ms_positioning="FlowLayout">Tip: You can click on any of the above
dates to
edit a different booking in this group</DIV>
</TD>
</TR>
</TABLE>
</form>
</body>
</HTML>