Make sure autopostback is set to true for the dropdown you want to postback
-----Original Message-----
From: John Tyson [mailto:jtyson@t...]
Sent: Friday, December 06, 2002 3:51 PM
To: ASPX_Professional
Subject: [aspx_professional] postback problems
Hi,
Can more than one control on an aspx form cause page postback?
The problem I am having is this: I have a hardware tracking page where the
user enters a newly purchased item's UPC. Entry in the textbox causes
postback and unhides a panel with a number of controls in it.
Within that panel, I have (among others) two dropdown fields: Hardware
Category and Hardware Subcategory. These two fields are set to default if a
prior entry with the same UPC is found; if not, the lists are built with
"not selected" as the selected item. SubCategory is dependent on the value
in Category; therefore, if the user changes the Category value I want to
repopulate the Subcategory dropdown list with appropriate selections based
on that Category selection.
I have three subs:
1. a page load sub that authenticates the user and sets the visible property
of the panel to false;
2. a default value sub that unhides and populates all controls in the panel
based on the UPC entered;
3. an onSelectedIndexChanged sub that repopulates the Subcategory dropdown
when the category dropdown is changed.
I think this is a problem with If Not Page.IsPostBack - I use this in the
first sub. I tried placing it in the second sub but then my panel wouldn't
unhide.
Can anyone offer me advice as to how I can correct this???
Thank you very much.
John