Click here to Skip to main content
16,016,345 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I have an application having more than 20 dropdowns and i m populating database fields to dropdownlist...the matter is when i want to enter the page having these dropdowns..it is taking so much time for page to start...

can any one suggest me how to make page to display very fast eventhough having many dropdowns with database fields

what m i thinking is to use javascript to populate database fields..so that performance may increase..what do you people think..

if my thinking seems to be right..can anyone tell me the code to use dropdown with javascript...
Posted

1 solution

Just because you use JavaScript doesn't mean your performance will increase. The first thing to consider is redesigning your application. Do you really need that many dropdowns on the initial page? Can the data be cached? Determine where the performance issues are. Do the database queries take longer or is the time spend in rendering?
 
Share this answer
 
Comments
[no name] 16-Nov-11 8:23am    
i think it is taking somuch time for rendering the page...and when dealing with dropdowns i'm dealing with a project which holds a large amount of data of realestate domain...
[no name] 18-Nov-11 2:24am    
prsently i m using jquery....but here i'm using multiple select buttons..but here alla the data is populating in only one selct button.... can anyone explain this


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="js/jquery-1.6.1.js"></script>

<script type="text/javascript">
//alert("aa")
$(document).ready(function()
{
getColumnData();
});

function getColumnData()
{
//alert("aa")
var selbox = $('select');
//alert(selbox.length)
//alert(img.length)
var temp;
for (var i=0;i<selbox.length;i++)
{
="" var="" temp="selbox[i].id;
" selobject="selbox[i];
"
="" alert(temp)
="" $.ajax({
="" url:"ajax.aspx?columnname="+temp,
success:function(data)
{
//alert(data)
var myArray=new Array()
if(data!=" ")
="" alert("aa")
="" myarray="data.split(",");" optn="document.createElement("OPTION");
" optn.text="Select" ;
="" optn.value="" selobject.options.add(optn);
="" for(var="" k="0;k<myArray.length;k=k+1)
" {="" }="" },
="" datatype:"text"
="" });

="" }
="" $('.masonryrecall').click(function(){
="" settimeout("$('#select').masonry()",="" 10);
="" });


="" &lt;="" script="">

<script type="text/javascript">
$("button").click(function() {
$("div.first").slideUp(300).delay(800).fadeIn(400);
$("div.second").slideUp(300).fadeIn(400);
});
</script>





</head>
<body>
<form id="form1" runat="server">
<div>
 <select id="City" name="City" style="width:200px" ></select>
<select id="RecordNo" name="RecordNo" style="width:200px"></select>
<select id="County" name="County" style="width:200px"></select>
<%-- <select id="Street Name" name="Street Name" style="width:200px"></select>
<select id="Comps" name="Comps" style="width:200px"></select>
<select id="Zip" name="Zip" style="width:200px"></select>
<select id="Subdivision" name="Subdivision" style="width:200px"></select>
<select id="Zone" name="Zone" style="width:200px"></select>
<select id="Yr Built" name="Yr Built" style="width:200px"></select>
<select id="SquareFt" name="SquareFt" style="width:200px"></select>
<select id="LotSize" name="LotSize" style="width:200px"></select>
<select id="CompetitiveBid" name="CompetitiveBid" style="width:200px"></select>
<select id="FileNo" name="FileNo" style="width:200px"></select>
<select id="Atty No" name="Atty No" style="width:200px"></select>
<select id="Street No" name="Street No" style="width:200px"></select>
<select id="Bedrooms" name="Bedrooms" style="width:200px"></select>
<select id="Tax Value" name="Tax Value" style="width:200px"></select>
<select id="Mortgage Amount" name="Mortgage Amount" style="width:200px"></select>
<select id="Atty Name" name="Atty Name" style="width:200px"></select>
<select id="Comments" name="Comments" style="width:200px"></s
[no name] 18-Nov-11 8:01am    
unreadable garbage

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900