Connecting Tech Pros Worldwide Help | Site Map

GIFS not working properly in JavaScript PopUps

Charleees
Guest
 
Posts: n/a
#1: Jun 10 '06
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

Randy Webb
Guest
 
Posts: n/a
#2: Jun 10 '06

re: GIFS not working properly in JavaScript PopUps


Charleees said the following on 6/10/2006 2:37 AM:[color=blue]
> 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..[/color]

Show the HTML and Javascript that gets sent to the browser.
[color=blue]
> the pop up is actually a DIV tag.. with a GIF image in it......[/color]

Ok, how are you making the "popup" appear?
[color=blue]
> 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....[/color]

Easy enough.
[color=blue]
> 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");[/color]

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

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Charleees
Guest
 
Posts: n/a
#3: Jun 10 '06

re: GIFS not working properly in JavaScript PopUps



Randy Webb wrote:
[color=blue]
> Charleees said the following on 6/10/2006 2:37 AM:[color=green]
> > 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..[/color]
>
> Show the HTML and Javascript that gets sent to the browser.
>[color=green]
> > the pop up is actually a DIV tag.. with a GIF image in it......[/color]
>
> Ok, how are you making the "popup" appear?
>[color=green]
> > 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....[/color]
>
> Easy enough.
>[color=green]
> > 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");[/color]
>
> That looks more like server side VB than Javascript. Post the HTML that
> gets sent to the browser.
>
> --
> Randy
> comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
> Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/[/color]

Charleees
Guest
 
Posts: n/a
#4: Jun 10 '06

re: GIFS not working properly in JavaScript PopUps


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>

Randy Webb
Guest
 
Posts: n/a
#5: Jun 10 '06

re: GIFS not working properly in JavaScript PopUps


Charleees said the following on 6/10/2006 5:46 AM:[color=blue]
> thanks,[/color]

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.

<URL: http://www.safalra.com/special/googlegroupsreply/ >
[color=blue]
> he is the Script....[/color]

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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Closed Thread