![]() |
Template Column & Javascript
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> |
Re: Template Column & Javascript
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" <steve.henderson@btinternet.c0m> wrote in message news:eUpvyYxXFHA.2288@TK2MSFTNGP14.phx.gbl... > 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> > > |
| All times are GMT. The time now is 11:55 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.