473,287 Members | 1,616 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,287 software developers and data experts.

hyperlink with Javascript and databinder

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:sch emas.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>

May 16 '06 #1
2 1870
Have you tried using

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

instead of window.location.href()?

--------------------
From: OT*********@shaw.ca
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: <11*********************@j33g2000cwa.googlegroups. com>
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: gr**********@google.com
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: gr**********@google.com
Injection-Info: j33g2000cwa.googlegroups.com; posting-host=162.106.6.3;
posting-account=0Wiv9QwAAADDeuw6FR7X-A3eO2QgrBmp
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFT FEEDS01.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.ne t!216.239.36.134.MISMATC
H!postnews.google.com!j33g2000cwa.googlegroups.com !not-for-mailXref: 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:sc hemas.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.

May 16 '06 #2
Hi,

OT*********@shaw.ca wrote:
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
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
May 20 '06 #3

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

Similar topics

3
by: Kumar | last post by:
Hi Folks, I have a question regarding conditional hyperlink in datagrid. I want to display Hyperlink if my QID values in (1,4,5,6) other wise i want to display just Qdescription with out...
0
by: Arjen | last post by:
Hello, Here is my datalist. <asp:DataList id="myDataList" CellPadding="4" Width="100%" runat="server"> <ItemTemplate> <span class="Normal"> <asp:HyperLink id="link" Text='<%#...
0
by: Ryan Harvey | last post by:
Hi all, I have written a web user control that contains a repeater control. the ItemTemplate for this control is basically 6 Hyperlinks in a row, that are dynamically allocated one of 7 gif...
5
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below...
1
by: Greg Reynolds | last post by:
Hi, I need to create datagrid hyperlink columns with multiple parameters in the URL. In my research on how to do this, it is recommended to create a template column which I have done. The code...
2
by: BobRoyAce | last post by:
I am brand new to ASP.NET and am now required to take over maintenance of a ..NET/C# web application. On one of the pages I'm working on there is a DataGrid which has multiple columns. One of the...
4
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile"...
1
by: ashtek | last post by:
Hi, I am using a hyperlink on a datagrid (templatecolumn) to display a link. Onclick of this link I want to open a new window without tool bar & with certain width & height. I am using this code...
7
by: ashtek | last post by:
I have an <ASP:HYPERLINKon a datagrid (templatecolumn) and I need to open a new window with no toolbar and specific height & width onclick of the link. I also want to pass the PK to this new...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.