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

x
?
Solved

Drop Down / AutoPostBack refreshes entire page

Posted on 2009-12-16
5
Medium Priority
?
873 Views
Last Modified: 2012-05-08
-ASP.NET (VB)
-IIS
-SQL 2005

I'm developing a very simple front end for an asset management system. To make it a short story, I have two drop down boxes, both populated by SQL queries. Let's call them Make and Model.

Make is populated automatically during the page load with data from the Make table. Model is a subsequent query, based on the drop-down selection of the Make. Quick example..

Make = Dell

Model is populated with (select model_name from model where make='Dell').. so it might display the following choices..

D600
D610
D800
etc.

The problem arises when 'Make' is chosen. I'm using the AutoPostBack=True method to refresh the model query. This, however, refreshes the entire page. There's a lot on this page that I haven't mentioned, which makes this method very slow.

How do I have just the drop-down list / query results refresh, without the entire page? Is there an easy method using ASP/VB to do this? From what I understand, Ajax would probably be an easy solution, but I don't even know where to being with Ajax (so if that's your suggestion, I would very much appreciate a link to a simple tutorial).

Thanks!

Brandon

0
Comment
Question by:Brandon_Sidley
5 Comments
 
LVL 4

Expert Comment

by:justin-clarke
ID: 26064368
Yep AJAX is your best bet.

Most tutorials are in C# though...

http://aspalliance.com/716_Populating_a_DropDownList_using_AJAX_and_ASPNET.4
0
 
LVL 7

Expert Comment

by:waltersnowslinarnold
ID: 26064430
Since your need is too tiny, you can use UpdatePanel Control, which will avoid the whole page reloading.

you can reach that here.,

http://www.asp.net/learn/ajax/tutorial-01-cs.aspx
0
 
LVL 18

Assisted Solution

by:Richard Lee
Richard Lee earned 240 total points
ID: 26064560
Wrap the drop down list in an UpdatePanel.

<asp:UpdatePanel runat="server">
   <ContentTemplate>
       // Place drop down lists here
   </ContentTemplate>
<asp:UpdatePanel>

DaTribe
0
 
LVL 7

Accepted Solution

by:
waltersnowslinarnold earned 260 total points
ID: 26064615
When you use UpdatePanel as below, you should have a <asp:ScriptManager ID="smTest" runat="server" > </asp:ScriptManager> for the page.

then, you can use the following code.,

<asp:UpdatePanel runat="server">
   <ContentTemplate>
       // Place drop down lists here
   </ContentTemplate>
<asp:UpdatePanel>
0
 
LVL 18

Expert Comment

by:Rajar Ahmed
ID: 26064768
Ajax tutorial dat loads data from db without page refresh  refresh ....

This examples shows wat i mentioning . u need just to configure dat combobox instead of that table load on the onchange of combobox in that demo .
http://www.w3schools.com/ajax/ajax_database.asp 

Can u try this ??

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
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. …
Suggested Courses
Course of the Month12 days, 14 hours left to enroll

579 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