hi
i use of this code for fetch value from database :
<style type="text/css">
.progresspanel
{
background-color: RED;
color: White;
top: 1px;
color: white;
position: absolute;
right: 16px;
z-index: 900;
}
</style>
<script type="text/javascript">
function showCustomer() {
var e = document.getElementById('<%=DropDownList1.ClientID%>');
var str = e.options[e.selectedIndex].value;
var xmlhttp;
if (str == "") {
document.getElementById("txtHint").innerHTML = "";
return;
}
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET", "getcustomer.aspx?q=" + str, true);
xmlhttp.send();
}
</script>
/////////////////////
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList >
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdateProgress ID="UpdateProgress1" runat="server"
AssociatedUpdatePanelID="Panel" DisplayAfter="0" DynamicLayout="True">
<ProgressTemplate>
<div style="width:100px;height:30px;" class='progresspanel'>
Loading...
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel runat="server" id="Panel">
<ContentTemplate>
<input type="button" value="ok" id="UpdateButton" runat="server" OnServerClick="UpdateButton_Click" onclick="showCustomer();"/>
</ContentTemplate>
</asp:UpdatePanel>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DropDownList1.Items.Add("jenifer");
DropDownList1.Items.Add("dani");
}
}
protected void UpdateButton_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(5000);
}
and when i click on button display both of them (Loding..... and my result ) but i want first dispaly loding.... and after that display my result
please help me