473,385 Members | 1,275 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Hide Panel as soon as button is clicked.

Hi,

I have one .net page which processes a form and then displays the
result. The coding which takes place in order to process the form
takes a while so I want to have some sort of display to the user.

So what I want is that as soon as the button has been clicked, the
Panel holding the form is hidden and then another panel is shown with
a gif image that looks like a loading image.

Just now when I want to do this, the code has to complete before the
Panel is hidden.

Thanks

Feb 1 '07 #1
1 1537
Howdy,

Example:

<asp:Panel runat="server" ID="processingPanel" Style="position:absolute;
width:300px;display:none">
Processing...<img />
</asp:Panel>

<asp:Panel runat="server" ID="formPanel">
<asp:TextBox runat="server" ID="txtSomeData"/>
<asp:Button runat="server" ID="btnProcess"
OnClientClick="ShowProcessingPanel()"
Text="Process" OnClick="btnProcess_Click"/>
</asp:Panel>

<script type="text/javascript">
<!--
function ShowProcessingPanel()
{
var formPanel = document.getElementById('<%=formPanel.ClientID %>');
var processingPanel = document.getElementById('<%=processingPanel.Client ID
%>');

formPanel.style.display = 'none';
processingPanel.style.display = 'block';

return true;
}
//-->
</script>

<script runat="server">
protected void btnProcess_Click(object sender, EventArgs e)
{
// simulate long processing on the server
System.Threading.Thread.Sleep(500);
}
</script>
--
Milosz
"TheDude5B" wrote:
Hi,

I have one .net page which processes a form and then displays the
result. The coding which takes place in order to process the form
takes a while so I want to have some sort of display to the user.

So what I want is that as soon as the button has been clicked, the
Panel holding the form is hidden and then another panel is shown with
a gif image that looks like a loading image.

Just now when I want to do this, the code has to complete before the
Panel is hidden.

Thanks

Feb 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: MOHSEN KASHANI | last post by:
Hi, I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: <head> <style> ..noshow {...
5
by: dje | last post by:
In the OnClick event on a radioButtonList, I run a javascript to show/hide the appropriate div along with a submit button, which displays as expected. The problem is the submit no longer works on...
1
by: Andy Sutorius | last post by:
Hi, I have 4 panels, each panel has a dropdown and a "next" button. I would like to get the selected value of the dropdown after the next button is clicked. I thought I could use the following...
4
by: Shapper | last post by:
Hello, I have an image button in a web page. The default image is ShowPanel.gif. When the image is clicked I want the panel "myPanel" to become visible and the image button to change to...
9
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
1
by: shapper | last post by:
Hello, I created an Asp:Repeater where I have an Asp:Panel and an Asp:Label. In each record of the repeater I want to have a small button which hides or shows the panel in that record. If...
3
by: timplx | last post by:
Hello all, New to javascript and have never worked with programming languages like c++, so my logic in some of these statements might be incorrect or redundant Got a problem with my page......
5
by: deepakthegeek | last post by:
I dont know if this kind of issue has been addressed earlier. I have a gridview control on a form, in the EditItem Template when a textbox is clicked, I have a popupcontrolextender displaying an...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.