karakav
asked on
ASP.NET,Javascript: Message while retreiving data from database
Hi,
I have a gridview in which I mantain sorting and paging. The problem is that some times it takes time (more that 15 seconds) to show a new page or the resut of a sort. I would like to know how I can show a message to the user, telling that the the system is looking for data. Please don't give me ajax solution as I am not using it in my application.
I have a gridview in which I mantain sorting and paging. The problem is that some times it takes time (more that 15 seconds) to show a new page or the resut of a sort. I would like to know how I can show a message to the user, telling that the the system is looking for data. Please don't give me ajax solution as I am not using it in my application.
ASKER
I think you didn't read well my thread. I say that Ajax is NOT an option for me.
sorry my fault
http://www.daniweb.com/forums/thread30366.html is a javascript based sampel but you will have to improvise on that as the demo is called for a specific period time but in your case you might want to hide the progress bar after you results have been bound on the grid on the postback
http://www.daniweb.com/forums/thread30366.html is a javascript based sampel but you will have to improvise on that as the demo is called for a specific period time but in your case you might want to hide the progress bar after you results have been bound on the grid on the postback
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Actually I would be thankful if you send me a snippet. I failed to implement you solution I don't know why.
well you should tell me where you are facing the problem. its easier to sort that way.
the snippet will be only for the toggle function, the rest you need to implement the way i have listed.
i have writtern the code as well in between the lines. its not much of coding actually...
the snippet will be only for the toggle function, the rest you need to implement the way i have listed.
i have writtern the code as well in between the lines. its not much of coding actually...
ASKER
Actually because I am accessing a single method from many locations(sorting,pageinde x,page load) I put the following code before and after calling the database:
//Code behind
private void GetData()
{
....
ClientScript.RegisterStartupScript(typeof(String), "busy", "toggleLabel('none') ;", true);
//The data retreival logic goes here
ClientScript.RegisterStartupScript(typeof(String), "freenow", "toggleLabel('') ;", true);
}
//Here is the Javascript function
function toggleLabel(condi)
{
document.getElementById("lblProgress").style.display = condi;
}
not sure what for you are using the ClientScript.RegisterStart upScript part.
use the below toggle function in your main page for activity.
<script type="text/javascript">
function toggleVisibility()
{
var control = document.getElementById("b usy");
if(control.style.visibilit y == "visible" || control.style.visibility == "")
{
control.style.visibility = "hidden";
}
else
{
control.style.visibility = "visible";
}
}
</script>
and follow all the steps i mentioned in option 2 and call this function.
use the below toggle function in your main page for activity.
<script type="text/javascript">
function toggleVisibility()
{
var control = document.getElementById("b
if(control.style.visibilit
{
control.style.visibility = "hidden";
}
else
{
control.style.visibility = "visible";
}
}
</script>
and follow all the steps i mentioned in option 2 and call this function.
ASKER
Thank you Champion. You really are the best. Thank you very much.
ASP.NET/ AJAX Page Loader Progress Bar/ Splash Screen - http://www.codeproject.com/KB/aspnet/ASPNETAJAXPageLoader.aspx