Confused: page postbacks problemn. Please help

G

Guest

Hello,
I am very confused. Here is my situation: I have a web form with a few
fields in place that are used as search criteria for a SQL database. Since I
want the search criteria to be specific, I allow users to select values from
a dropdown list, and add them to a listbox. When the users selects a value
from the dropdown list and clicks "add", the page posts back very quickly and
adds the value into the listbox. This works as it should. When I run the
query, I get back a set of data, I format the data how I want it and display
it in a label. I know a datagrid would be simpler, but for the time being, I
need it to be displayed in a label. Anyway, this all works fine, here is my
problem. lets say the search takes 5 seconds to complete (huge database).
If after the initial query, I try and add some other search values to the
listbox, the post back event to add the new value now takes 5 seconds. It is
almost like clicking the "add" button is re-running the query again, before
adding the selected values to a listbox? I have anothe search page that
searches using the indexing service and the same thing occurs. When I debug
the application, the long delay seems to be occuring during the
InitializeComponent() function within the Page_Init Sub. Any help here would
be greatly appreciated.

MoeH
 
K

Karl Seguin

The search isn't happening again (you can double check this by profiling
yoru database). My guess is that your page is having to reconstruct a lot
of information (namely the viewstate). add Trace="True" to your @Page
directive and look for a huge viewstate...

Karl
 
R

Remy

Maybe a postback happens when you use your dropdown. Check the
AutoPostBack in the dropdown element, it should be set to false. You
can also just set a breakpoint in the method that calles the search
query and see when it is called.

Remy Blaettler
www.collaboral.com
 

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

Similar Threads

I dont get this. Please help me!! 2
Help please 8
Code help please 4
Hello and Help please :-) 1
Please, help me. 1
Help with my responsive home page 2
Help Needed with VBA please help 0
Need help again please 19

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top