hyperlink with Javascript and databinder

Discussion in 'ASP .Net' started by OTSolutions@shaw.ca, May 16, 2006.

  1. Guest

    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>
    , May 16, 2006
    #1
    1. Advertising

  2. Have you tried using

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

    instead of window.location.href()?

    --------------------
    >From:
    >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: <>
    >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:
    >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:
    >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.
    Nanda Lella[MSFT], May 16, 2006
    #2
    1. Advertising

  3. Laurent Bugnion, May 20, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raterus
    Replies:
    1
    Views:
    1,954
    =?Utf-8?B?cCBkaWV0eg==?=
    May 24, 2004
  2. Luis E Valencia

    Concatenate Hyperlink with databinder

    Luis E Valencia, May 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,697
    Luis E Valencia
    May 27, 2004
  3. Kylin
    Replies:
    0
    Views:
    360
    Kylin
    Jun 20, 2005
  4. davetichenor
    Replies:
    1
    Views:
    819
    Eliyahu Goldin
    Oct 30, 2006
  5. Ken
    Replies:
    1
    Views:
    371
    Alvin Bruney
    Aug 16, 2003
Loading...

Share This Page