Template Column & Javascript

Discussion in 'ASP .Net Web Services' started by Steve, May 22, 2005.

  1. Steve

    Steve Guest

    Hi,

    I have a datagrid with a template column in that I'm using to open a link so
    that users can drill down to the next level of some data. I'd really like to
    utilise javascript so that I can set the properties of the new window that's
    opened but can't get it to work despite looking through the other posts in
    the forum that relate to this.

    My column code is attached - can anyone give me a pointer

    Thanks

    Steve

    <asp:TemplateColumn HeaderText="Team">
    <ItemTemplate>


    <asp:HyperLink id=Hyperlink1 runat="server" Target="_blank" Text='<%#
    DataBinder.Eval(Container.DataItem, "team name") %>' NavigateUrl='<%#
    "teamreports.aspx?DateFrom="& DateFrom.Text & "&DateTo=" & DateTo.Text &
    "&Team=" & DataBinder.Eval(Container.DataItem, "team") & "&var_Agent=" &
    Agent.checked & "&var_SCA=" & SCA.checked & "&var_TM=" & TMs.checked%>'>
    </asp:HyperLink>
    </ItemTemplate>
    </asp:TemplateColumn>
    Steve, May 22, 2005
    #1
    1. Advertising

  2. Steve,

    Don't use HyperLink. Use a Label and setup client side onclick event that
    will call a javascript function with a parameter where you will pass the url
    you want to navigate to. In the javascript open a new window in the way you
    wish.

    Eliyahu

    "Steve" <0m> wrote in message
    news:...
    > Hi,
    >
    > I have a datagrid with a template column in that I'm using to open a link

    so
    > that users can drill down to the next level of some data. I'd really like

    to
    > utilise javascript so that I can set the properties of the new window

    that's
    > opened but can't get it to work despite looking through the other posts in
    > the forum that relate to this.
    >
    > My column code is attached - can anyone give me a pointer
    >
    > Thanks
    >
    > Steve
    >
    > <asp:TemplateColumn HeaderText="Team">
    > <ItemTemplate>
    >
    >
    > <asp:HyperLink id=Hyperlink1 runat="server" Target="_blank" Text='<%#
    > DataBinder.Eval(Container.DataItem, "team name") %>' NavigateUrl='<%#
    > "teamreports.aspx?DateFrom="& DateFrom.Text & "&DateTo=" & DateTo.Text &
    > "&Team=" & DataBinder.Eval(Container.DataItem, "team") & "&var_Agent=" &
    > Agent.checked & "&var_SCA=" & SCA.checked & "&var_TM=" & TMs.checked%>'>
    > </asp:HyperLink>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    >
    >
    Eliyahu Goldin, May 23, 2005
    #2
    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. Dexter
    Replies:
    1
    Views:
    418
    Eliyahu Goldin
    Jan 18, 2005
  2. Ken Varn
    Replies:
    1
    Views:
    975
    Ken Varn
    Aug 19, 2005
  3. Charleees
    Replies:
    2
    Views:
    8,207
    Eliyahu Goldin
    Jun 20, 2006
  4. Ravichandran Mahalingam

    Bound Column or Template Column (w dAdapater?) in DataGrid

    Ravichandran Mahalingam, Jan 9, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    220
    Ravichandran Mahalingam
    Jan 9, 2004
  5. Esperanza

    Template column base on another column value

    Esperanza, Feb 18, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    5
    Views:
    175
    Elton Wang
    Feb 21, 2005
Loading...

Share This Page