Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Template Column & Javascript

Reply
Thread Tools

Template Column & Javascript

 
 
Steve
Guest
Posts: n/a
 
      05-22-2005
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>


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      05-23-2005
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>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting Column width of Template Column in Datagrid.. Charleees ASP .Net 2 06-20-2006 12:52 PM
DataGrid loses view state if first column is a template column. Ken Varn ASP .Net 1 08-19-2005 02:54 PM
Template column base on another column value Esperanza ASP .Net Datagrid Control 5 02-21-2005 04:02 PM
how to know if a datagrid column is a template column? Dexter ASP .Net 1 01-18-2005 01:45 PM
Bound Column or Template Column (w dAdapater?) in DataGrid Ravichandran Mahalingam ASP .Net Datagrid Control 0 01-09-2004 03:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57