473,326 Members | 2,111 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,326 software developers and data experts.

Error 500 ONLY on first postback from certain controls

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?

Nov 3 '06 #1
1 1486

te********@hotmail.com wrote:
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

Nov 6 '06 #2

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

Similar topics

16
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
1
by: AA | last post by:
Hi I have a form on client end where I have certain controls. Now whenever the app is run, the postback is done from the server. But for few controls I do not want them to go to the server for...
1
by: Angel | last post by:
I have added controls to the placeholder control. All the controls that were added have EnableViewState = true including the placeholder. One of the controls has a button that performs a postback. My...
1
by: Lamont Adams | last post by:
Hi all, I've created numerous custom controls of varying complexity, but I've been on this problem for a day and a half, and I can't figure this mystery out. I hope one of you kind folks can...
3
by: Martin | last post by:
Hi, I have an aspx page with two dropdownlist controls. I update the options in the second ddl based on selection made in the first. I do this with the ICallbackEventHandler interface, as per...
2
by: Wizzard | last post by:
I have a repeater with and imagebutton on a page useing VS2005 ASP.Net 2.0 <asp:Repeater ID="Repeater1" runat="server" > <ItemTemplate> <div> <asp:ImageButton ImageUrl="button.gif"...
1
by: teddysnips | last post by:
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...
5
by: Bjorn Sagbakken | last post by:
Hello I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0 I am at the end of debugging and fixing stuff. Now there is one error I just cannot find a solution to: On...
2
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.