Urgent help needed

4 views
Skip to first unread message

Ram Kumar

unread,
Oct 17, 2005, 7:00:33 AM10/17/05
to Techdot...@googlegroups.com
Hi friends,
 
  I want this task to be done within 3 hours..requirement is this When a form is submitted an animated GIF image needs to be displayed to user that the next page is being loaded.
 
There are ways to implement this, for example progress bar, but that can cause some performance issues. Another reason I don't need the status bar is that iam not going to give the user an actual indication of progress during long running requests. 
 
I want something very simple. I just want to indicate to the end-user that something is happening. Also,I do not want to display a static message. Simply display of an animated gif image that needs to hide when the form is returned.
 
Can u help me?????plz itz urgent..Tell me something in detail so tht i can finish this
 
bye
ram

BabuLives

unread,
Oct 17, 2005, 7:06:47 AM10/17/05
to .NetIndia

Ram Kumar

unread,
Oct 17, 2005, 7:24:16 AM10/17/05
to Techdot...@googlegroups.com
Hi babu,
 
    I just went to tht site and i got the sample online test page in this
 
 
   here there will be static message..but i need gif image in tht still page load..after page load it should be hided.tell me quickly bcoz i want to finish within 1 hour
 
bye,
ram

 

natarajan...@wipro.com

unread,
Oct 17, 2005, 7:48:48 AM10/17/05
to Techdot...@googlegroups.com
Hi Ram,
 
This can be done with simple HTML and Javascript..
 
In the page in which u wanted to display the gif image, have a " html form". Plz refer the below code..
 
<head>
<form name="frmLoading">
<div id=divLoading align=left style="position:absolute; z-index:1;">
<img src="gears.gif" name="imgLoading">
 <br> 
</div>
</form>
</head>
 
 
Then have the below Javascript code:
 
function hideLoadingMsg()
{
document.poppedLayer = eval('document.getElementById(\'divLoading\')');
document.poppedLayer.style.visibility = "hidden";
 
}
 
Then call the above Javascript function in the Body tag onload event
 
<body onload="javascript:hideLoadingMsg()">
 
This i have done in an ASP Page. You can modify it for ASP.Net page accordingly.
 
The idea here is that have a separate form for displaying the gif image and hide that form when page got loaded.
It will display the Gif image till the page completely got loaded.
 
Regards,
Natraj.

Ram Kumar

unread,
Oct 17, 2005, 8:08:23 AM10/17/05
to Techdot...@googlegroups.com
Hi natraj,
 
   here in asp.net for the java script there is no document.Poppedlayer....So wat to do
 
bye
ram

 

natarajan...@wipro.com

unread,
Oct 18, 2005, 12:19:48 AM10/18/05
to Techdot...@googlegroups.com
Ram,
 
Sorry for the late reply as yesterday i left office early..
 
document.poppedLayer should be supported in ASP.Net
 
What is that saying when u compile it?

Ram Kumar

unread,
Oct 18, 2005, 2:07:38 AM10/18/05
to Techdot...@googlegroups.com
Hi natraj,
 
   Yesterday  i got tht one..
   steps are as follows:
   1.place a hidden div element in the page initially...
     <DIV id="MessageDiv" style="BORDER-RIGHT:thin outset; BORDER-TOP:thin outset; FONT-WEIGHT:bold; FONT-SIZE:medium; Z-INDEX:101; LEFT:105px; VISIBILITY:hidden; BORDER-LEFT:thin outset; WIDTH:256px; COLOR:#000099; BORDER-BOTTOM:thin outset; FONT-FAMILY:Verdana; POSITION:absolute; TOP:185px; HEIGHT:56px; BACKGROUND-COLOR:#ffcc66; TEXT-ALIGN:center" ms_positioning="FlowLayout">&nbsp;
    <img id="progressBarImg" src="Giff image location">
   </DIV>
   2.Add a javascript which sets visibility true
      function doClick() { MessageDiv.style.visibility = "visible"; }
   3.Call tht function in the button control...
       Send_Button.Attributes.Add("onclick", "doClick()");
 
     Here it works for ordinary images but if we provide giff images itz not working..Because IE hides the graphics of the giff image...soln for tht one is to provide src again and again but i cant complete the solution....
   Basically, what we need to do is reload the image after the form has been submitted. Keep in mind an image is reloaded when it's "src" attribute is assigned a value. So, we need to do the following ... But i cant uunderstand and i tried cant get it..canu  help me

1. Declare a method for "onsubmit":

function formSubmit()
{
document.myForm.action = "YOUR URL TO SUBMIT";
document.myForm.submit();

// Reload your animated GIF image
if (document.images) document.progressImage.src = document.progressImage.src;

return false; // because we're doing the submit in this method
}

2. Modify your form declaration (make sure you don't leave out the "return" from the onSubmit value):

<form enctype="multipart/form-data" action="" method="post" name="myForm" onSubmit="return formSubmit()">


 

BabuLives

unread,
Oct 19, 2005, 2:00:50 AM10/19/05
to .NetIndia
Hi Ram,

Your requirement can be done.

You have to place the image in ur ASPX page as a client side cntrol.

<img id="imgProcess" src="process.gif" style="visibility:hidden">

Then you have to add the property of the button as

btnSave.Attributes.Add("onclick","chkProgressBar();");
[this is in the page onload function]

For the chkProgressBar function you have to write the client side event
as

function ProgressBar()
{

if (!Page_ClientValidate())
return false;
else
{
document.Form1.imgWait.style.visibility = "visible";
document.Form1.submit();
}
}

The image will display imm wen the button is pressed in the client side
itself.

Happy Programming

..::STEVE

I blog at http://spaces.msn.com/members/msjawahar

Reply all
Reply to author
Forward
0 new messages