Selected Option values resolving as empty string on asyncpostback

J

John Kotuby

Hi all,

Usining VS2008 and VB I have a usercontrol that serves as an advanced search
tool. It is comprised of a bunch if HTML input fields including Selects
along with some aspnet input controls. It also has a Grid that is populated
with the results of the search.
The Grid is contained in an update panel and the asp "Submit Search" button
is defined as its AsynchPostback trigger.

<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"
EnableViewState="true"></asp:ScriptManagerProxy>

<asp:UpdatePanel ID="updKeywordSearch" runat="server"
UpdateMode="Conditional" EnableViewState="true"
ChildrenAsTriggers="false">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSearch" />
</Triggers>

As you notice I use a ScriptManagerProxy as the parent page also contains
update panels. I have not nested any update panels.

Here is the code that retieves the value form the Select element upon
postback:

filterCons = UCase(Request.Form("filterCons"))

Where "filterCons" is the name of one of the Select elements.

Even though the HTML source of the page clearly shows a Selected option, the
value at the postpack is an empty string.
This is true for all of the Select elements in that user control.

What bothers me is that I have a very similar control that just lacks the
Grid inside of an update panel, and so the btnSearch is not defined as an
AsyncPostBackTrigger but rather does a standard postback and saves the
retieved values back to a database.

In this case the exact same code:
filterCons = UCase(Request.Form("filterCons"))
....returns the expected value.

In fact the code for both controls is nearly identical except for the grid
in the Update Panel.

I don't understand why there should be a difference?

Can anyone explain? Thanks for any help.
 
J

John Kotuby

I guess I will repost this as a Bug in ASP.NET 3.5.
When my form does a nomal postback I can read all the values of the Input
controls except for the Selected Options of any HTML Select elements.

When I do an Acynch postback with an UpdatePanel all the values from all my
Select elements come back as empty strings.
It is my understanding that an UpdatePanel postback allows access to all
form controls...HTML or ASP.

Hasn't anyone else seen this problem?
Thanks...
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top