How to make a DropDownlist PostBack smoother

Posted on 2008-11-06
Last Modified: 2010-04-21
I have a dynamic drop downlist on my Form, but when ever the user selects his value, it jumps around back to the top of the page, and then the user has to scroll back down to the page to where they left off. It is rather annoying. Is there a way to have the page not move. I hear you can use AJAX but I'm not very familiar with how that works.

		<br />

		Select Basin:

		<br />

		<asp:dropdownlist id="ddlBasin" runat="server" AutoPostBack="True" 

    DataSourceID="SqlDataSource1" DataTextField="Basin" 


<asp:SqlDataSource id="SqlDataSource1" runat="server" 

    ConnectionString="<%$ ConnectionStrings:Prop_ChangeConnectionString %>" 

    SelectCommand="SELECT [Basin] FROM [PC_CoalBasin]"></asp:SqlDataSource>

<br />

Select Ownership Codes:

<br />

<asp:dropdownlist id="ddlOwnership" runat="server" DataSourceID="SqlDataSource2" 

    DataTextField="Ownership" DataValueField="Ownership"></asp:dropdownlist>

<asp:SqlDataSource id="SqlDataSource2" runat="server" 

    ConnectionString="<%$ ConnectionStrings:Prop_ChangeConnectionString %>"    

    SelectCommand="SELECT [Ownership] FROM [PC_BasinOwnership] WHERE ([Basin] = @Basin)">


        <asp:ControlParameter ControlID="ddlBasin" Name="Basin" 

            PropertyName="SelectedValue" Type="String" />



Open in new window

Question by:GravitaZ24
    LVL 13

    Accepted Solution

    do that in web.config
    <pages  maintainScrollPositionOnPostBack="true">
    LVL 13

    Expert Comment


    Author Closing Comment

    Thank you, that worked great! I don't have time to learn AJAX right now, but I'll definitely look into that for future projects.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now