Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to make a DropDownlist PostBack smoother

Posted on 2008-11-06
3
Medium Priority
?
200 Views
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.
Coal:
		<br />
		Select Basin:
		<br />
		<asp:dropdownlist id="ddlBasin" runat="server" AutoPostBack="True" 
    DataSourceID="SqlDataSource1" DataTextField="Basin" 
    DataValueField="Basin"></asp:dropdownlist>
<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)">
    <SelectParameters>
        <asp:ControlParameter ControlID="ddlBasin" Name="Basin" 
            PropertyName="SelectedValue" Type="String" />
    </SelectParameters>
</asp:SqlDataSource>

Open in new window

0
Comment
Question by:GravitaZ24
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
sm394 earned 2000 total points
ID: 22896221
do that in web.config
<pages  maintainScrollPositionOnPostBack="true">
0
 
LVL 13

Expert Comment

by:sm394
ID: 22896253
0
 

Author Closing Comment

by:GravitaZ24
ID: 31513951
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.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

581 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