Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

Confused: page postbacks problemn.  Please help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Moe - 19 Oct 2005 13:44 GMT
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
Karl Seguin - 19 Oct 2005 14:07 GMT
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

Signature

MY ASP.Net tutorials
http://www.openmymind.net/

> Hello,
>    I am very confused.  Here is my situation:  I have a web form with a
[quoted text clipped - 29 lines]
>
> MoeH
Remy - 19 Oct 2005 14:11 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.