hyperlink with Javascript and databinder

O

OTSolutions

This line of code works in IE but not in Firefox or Netscape for some
reason.

Any ideas as to why would be appreciated,

It is the NavigateURL part. IE brings up the page, the other two
browsers it just does nothing.

Tom Olthoff

Line of code:

<asp:TemplateColumn HeaderText="Bus Stop #">
<HeaderStyle CssClass="gAlt2SubHeader"
VerticalAlign="Top"></HeaderStyle>
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%#
DataBinder.Eval(Container.DataItem,"Stop_ID")%>' NavigateUrl='<%#
"javascript:document.PCC.PutSessionState(""urn:schemas.coe.com:transit"",""BusStopNumber"","""
& cstr(DataBinder.Eval(Container,"DataItem.Stop_ID")) &
""");window.location.href(""http://acc.edmonton.ca/portal/server.pt?space=CommunityPage&control=SetCommunity&CommunityID=225"");"%>'
Target="_self" ID="Hyperlink2">
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
 
N

Nanda Lella[MSFT]

Have you tried using

window.open('NewPage.aspx');
or
location.replace('NewPage.aspx');

instead of window.location.href()?

--------------------
From: (e-mail address removed)
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: hyperlink with Javascript and databinder
Date: 16 May 2006 11:42:59 -0700
Organization: http://groups.google.com
Lines: 26
Message-ID: <[email protected]>
NNTP-Posting-Host: 162.106.6.3
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1147804984 1350 127.0.0.1 (16 May 2006 18:43:04 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Tue, 16 May 2006 18:43:04 +0000 (UTC)
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET
CLR 1.0.3705; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.0 CEPAPRX23, 1.0 CEPAPRX22
Complaints-To: (e-mail address removed)
Injection-Info: j33g2000cwa.googlegroups.com; posting-host=162.106.6.3;
posting-account=0Wiv9QwAAADDeuw6FR7X-A3eO2QgrBmp
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTFEEDS01.phx.gbl!newsfeed.c
w.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!news.r
h-tec.net!tiscali!newsfeed1.ip.tiscali.net!proxad.net!216.239.36.134.MISMATC
H!postnews.google.com!j33g2000cwa.googlegroups.com!not-for-mail
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.aspnet:397560
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

This line of code works in IE but not in Firefox or Netscape for some
reason.

Any ideas as to why would be appreciated,

It is the NavigateURL part. IE brings up the page, the other two
browsers it just does nothing.

Tom Olthoff

Line of code:

<asp:TemplateColumn HeaderText="Bus Stop #">
<HeaderStyle CssClass="gAlt2SubHeader"
VerticalAlign="Top"></HeaderStyle>
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%#
DataBinder.Eval(Container.DataItem,"Stop_ID")%>' NavigateUrl='<%#
"javascript:document.PCC.PutSessionState(""urn:schemas.coe.com:transit"","" BusStopNumber"","""
& cstr(DataBinder.Eval(Container,"DataItem.Stop_ID")) &
""");window.location.href(""http://acc.edmonton.ca/portal/server.pt?space=C ommunityPage&control=SetCommunity&CommunityID=225"");"%>'
Target="_self" ID="Hyperlink2">
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>

--

Thank You,
Nanda Lella,

This Posting is provided "AS IS" with no warranties, and confers no rights.
 
L

Laurent Bugnion

Hi,

This line of code works in IE but not in Firefox or Netscape for some
reason.

Didn't check the whole code, but location.href is a property, not a
method, so rather try

window.location.href = "...";

HTH,
Laurent
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top