473,614 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:TemplateCo lumn HeaderText="Bus Stop #">
<HeaderStyle CssClass="gAlt2 SubHeader"
VerticalAlign=" Top"></HeaderStyle>
<ItemTemplate >
<asp:HyperLin k runat="server" Text='<%#
DataBinder.Eval (Container.Data Item,"Stop_ID") %>' NavigateUrl='<% #
"javascript:doc ument.PCC.PutSe ssionState(""ur n:schemas.coe.c om:transit"","" BusStopNumber"" ,"""
& cstr(DataBinder .Eval(Container ,"DataItem.Stop _ID")) &
""");window.loc ation.href(""ht tp://acc.edmonton.ca/portal/server.pt?space =CommunityPage& control=SetComm unity&Community ID=225"");"%>'
Target="_self" ID="Hyperlink2" >
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateCol umn>

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

window.open('Ne wPage.aspx');
or
location.replac e('NewPage.aspx ');

instead of window.location .href()?

--------------------
From: OT*********@sha w.ca
Newsgroups: microsoft.publi c.dotnet.framew ork.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************ *********@j33g2 000cwa.googlegr oups.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**********@go ogle.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**********@go ogle.com
Injection-Info: j33g2000cwa.goo glegroups.com; posting-host=162.106.6. 3;
posting-account=0Wiv9Qw AAADDeuw6FR7X-A3eO2QgrBmp
Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP01.phx.gbl!TK 2MSFTFEEDS01.ph x.gbl!newsfeed. c
w.net!cw.net!ne ws-FFM2.ecrc.de!ne wsfeed01.sul.t-online.de!t-online.de!news. r
h-tec.net!tiscali !newsfeed1.ip.t iscali.net!prox ad.net!216.239. 36.134.MISMATC
H!postnews.goog le.com!j33g2000 cwa.googlegroup s.com!not-for-mailXref: TK2MSFTNGXA01.p hx.gbl microsoft.publi c.dotnet.framew ork.aspnet:3975 60
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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:TemplateC olumn HeaderText="Bus Stop #">
<HeaderStyle CssClass="gAlt2 SubHeader"
VerticalAlign= "Top"></HeaderStyle>
<ItemTemplat e>
<asp:HyperLin k runat="server" Text='<%#
DataBinder.Eva l(Container.Dat aItem,"Stop_ID" )%>' NavigateUrl='<% #
"javascript:do cument.PCC.PutS essionState(""u rn:schemas.coe. com:transit""," " BusStopNumber"" ,"""& cstr(DataBinder .Eval(Container ,"DataItem.Stop _ID")) &
""");window.lo cation.href(""h ttp://acc.edmonton.ca/portal/server.pt?space =C ommunityPage&co ntrol=SetCommun ity&CommunityID =225"");"%>'Target="_sel f" ID="Hyperlink2" >
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateCol umn>


--

Thank You,
Nanda Lella,

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

May 16 '06 #2
Hi,

OT*********@sha w.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
2587
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 hyperlink. <asp:hyperlinkcolumn headertext="Question" SortExpression="QDescription" datatextfield="QDescription"
0
2111
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='<%# Server.HtmlEncode((String) DataBinder.Eval(Container.DataItem,"Title")) %>' NavigateUrl='<%# DataBinder.Eval(Container.DataItem,"Url") %>' ToolTip='<%# DataBinder.Eval(Container.DataItem,"Description") %>' runat="server" />
0
550
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 images as the ImageURL of the Hyperlink. When a load the page with the controls on it works fine, but sometimes the images are broken, but if i hit refresh i get random selections of the gifs appearing and not appearing. if i hit Back button to a page...
5
6685
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 but here is the snippet of my asp:hyperlink object; <asp:HyperLink NavigateUrl="authonly/clientdetails.aspx?searchID="+<%#DataBinder.Eval(Conta iner.DataItem,"CLIENTREF")%> ID="Hyperlink1"><%#DataBinder.Eval(Container.DataItem,...
1
4082
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 I am using is creating the following error BC30203: Identifier expected. Source Error:
2
2607
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 columns is not databound and instead has up to three hyperlinks in it (Edit, Award, and Cancel). A couple of the hyperlinks should not be shown in certain cases. Now, mind you, I don't know if it's being done in the way that's best to do it. It...
4
2211
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" NavigateUrl="javascript:OpenImage('<%# DataBinder.Eval(Container.DataItem,"FileName") %>');"><%#
1
3530
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 <ASP:TEMPLATECOLUMN HEADERTEXT="Details"> <ITEMTEMPLATE> <ASP:HYPERLINK ID="lnkDetails" RUNAT="server" NAVIGATEURL='<%# "Details.aspx?ID=" + DataBinder.Eval(Container.DataItem,"ID")%>'
7
7043
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 window. <ASP:HYPERLINK ID="lnkNewWin" RUNAT="server" NAVIGATEURL="#" ONCLICK="javascript:window.open('NewWin.aspx?PK=<%# DataBinder.Eval(Container.DataItem,"PK")%>','','toolbar=0,width=600,height=600,scollbars=1')" TEXT="Click"></ASP:HYPERLINK> ...
0
8182
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8627
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8579
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8279
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7093
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6088
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4052
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.