Error 500 ONLY on first postback from certain controls

T

teddysnips

Visual Studio 2005

I have a moderately complicated form. It has four User Controls, which
are (somewhat simplified):

1. A tree control showing an employee hierarchy

Below a tab strip with three tabs:

1. A User Control containing a check box (AutoPostback = True), a
couple of labels and a grid (which is itself a user control, being a
handy wrapper for the standard Grid)

2. A User control containing a check box (AutoPostback = True), a
couple of labels, A COMBO BOX CALLED GOOD (AutoPostback = True), and a
grid.

2. A User control containing a check box (AutoPostback = True), a
couple of labels, A COMBO BOX CALLED BAD (AutoPostback = True), and a
grid.

So, I'm testing this baby and it looks spiffy. However, when I dropped
down the BAD combo box (thus causing the first PostBack) the
application barfed with "500: The server can't fulfill your request"
When I investigated further I found that ALL the other controls caused
the same error.

Except.

The GOOD combo box didn't barf - it did it postback as required.
What's really weird is that It then seemed to "enable" the rest of the
form so that all the other, previously barfing controls, now work
correctly. In other words, if I do this:

Load Form
Drop-down BAD combo

Result: 500: The server can't fulfill your request

However, if I do this:

Load Form
Drop-down GOOD combo
Drop-down BAD combo

Result: Happy user.

Anyone any thoughts?

Edward

Anyone got any ideas?
 
T

teddysnips

Visual Studio 2005

I have a moderately complicated form. It has four User Controls, which
are (somewhat simplified):[...]

I've worked out that the problem occurred with the only control
(cboStatus) on the form that was NOT throwing an exception (the GOOD
combo). However, if I removed the code to populate cboStatus the form
worked correctly.

This was the code:


Private Sub PopulateForm(ByVal stats As Delegator.Delegated.Statistics)

' Populate dropdowns
If Me.cboStatus.Items.Count <= 0 Then
WebUtils.Controls.DropDown.Populate(Me.cboStatus,
DirectObjective.List.GetStatusList)
End If


Public Shared Function GetStatusList() As SortedList
Dim Status As New SortedList
Status.Add("<select>", "<select>")
Status.Add("Not Agreed", "Not Agreed")
Status.Add("Agreed", "Agreed")
Status.Add("Approved", "Approved")
Return Status
End Function

However, and this is where it gets really weird, if I change the code
to populate the SortedList to this, it works (NOTE: the Key value
changed from a string to an integer).

Public Shared Function GetStatusList() As SortedList
Dim Status As New SortedList
Status.Add(-1, "<select>")
Status.Add(0, "Not Agreed")
Status.Add(1, "Agreed")
Status.Add(2, "Approved")
Return Status
End Function

Well, I'm baffled, but I've spent long enough on this.

Hope someone gets something from it.

Edward
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top