GIFS not working properly in JavaScript PopUps

C

Charleees

GIFS not working properly in JavaScript PopUps

Hi all,

I have a button and when i click tha button it redirects to another
page.....

I have also added a java script for the button that makes a popup..

the pop up is actually a DIV tag.. with a GIF image in it......

what actually should happen is ...

when i click the button ..the pop up should be visible with the
animated gif ..this should be visible till the processing is done and
the page is redirected....

popup here acts like a Processing bar...

The problem i have is ..

when i add this javascript... i could get the Gifs Animation...but the
button click is not called


SearchBtn.Attributes.Add("onclick","GetPosition('"+this.SearchBtn.ClientID+"');return
false");

if i do the following....

SearchBtn.Attributes.Add("onclick","GetPosition('"+this.SearchBtn.ClientID+"');return
true");
i could show the pop up till the processing is done and redirect but
the only problem is..... i could not have a proper animated gif image..

i have done the following in button click:


private void SearchBtn_Click(object sender, System.EventArgs e)
{
search.DoSearch();
Response.Redirect("searchResult.aspx);
}


how could i solve this problem... any alternate way..

its urgent..please help...

Thanks in Advance..

Sanjay.C
 
R

Randy Webb

Charleees said the following on 6/10/2006 2:37 AM:
GIFS not working properly in JavaScript PopUps

Hi all,

I have a button and when i click tha button it redirects to another
page.....

I have also added a java script for the button that makes a popup..

Show the HTML and Javascript that gets sent to the browser.
the pop up is actually a DIV tag.. with a GIF image in it......

Ok, how are you making the "popup" appear?
what actually should happen is ...

when i click the button ..the pop up should be visible with the
animated gif ..this should be visible till the processing is done and
the page is redirected....

Easy enough.
popup here acts like a Processing bar...

The problem i have is ..

when i add this javascript... i could get the Gifs Animation...but the
button click is not called


SearchBtn.Attributes.Add("onclick","GetPosition('"+this.SearchBtn.ClientID+"');return
false");

That looks more like server side VB than Javascript. Post the HTML that
gets sent to the browser.
 
C

Charleees

Randy said:
Charleees said the following on 6/10/2006 2:37 AM:

Show the HTML and Javascript that gets sent to the browser.


Ok, how are you making the "popup" appear?


Easy enough.


That looks more like server side VB than Javascript. Post the HTML that
gets sent to the browser.
 
C

Charleees

thanks,

he is the Script....

<%@ Page language="c#" Codebehind="Default.aspx.cs"
AutoEventWireup="false" Inherits="Dtf.WebSite.Default"
smartNavigation="False"%>
<%@ Register TagPrefix="uc1" TagName="Tracking" Src="Tracking.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title runat="server" id="title"></title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK id="style" type="text/css" rel="stylesheet" runat="server">
</LINK>
<script language="javascript"
src="ClientScripts/ProcessBar.js"></script>
<script language="javascript"
src="ClientScripts/TextBoxScript.js"></script>
<script language="javascript">

function showHideFormElements(value)
{
var formElements = document.forms(0).elements;
for(i=0 ; i < formElements.length ; i++)
{
if(formElements(i).tagName == "SELECT")
{
formElements(i).style.visibility = value;
}
}
}
function getElementPos(sElementID)
{
if(!document.getElementById) return null;
var e = document.getElementById(sElementID);
if(e == null ) return null;
var p = { x: 0, y: 0};
while(e)
{
p.x += parseInt(e.offsetLeft,10);
p.y += parseInt(e.offsetTop,10);
e = e.offsetParent;
}
return p;
}
function GetPosition(clientID)
{

showHideFormElements("hidden");
Popup.style.display = "block";
Popup.style.position = "absolute";
Popup.style.left = 123;
Popup.style.top = 128;

}

</script>
</HEAD>
<body bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">
<form id="main" method="post" runat="server">
</form>
<uc1:tracking id="Tracking1" runat="server"></uc1:tracking>
<div class="PopUp" id="Popup">
<TABLE class="PopupTable" id="PopupTable" height="500"
cellSpacing="0" cellPadding="0"
width="770" align="center" bgColor="white" border="0">
<tr>
<td vAlign="middle" align="center"><IMG
src="Images/FindingHotels_1_1.gif" border="0"></td>
</tr>
</TABLE>
</div>
</body>
</HTML>
 
R

Randy Webb

Charleees said the following on 6/10/2006 5:46 AM:

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

he is the Script....

Again, that is your server side code. Open the page in your browser,
right click>View source, and then post what the browser sees, not your
server side code. Or, post a URL to a sample page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top