1

I have a pdf file I get from a DataGrid and want to open it in a new window. Here is my code:

<ItemTemplate><asp:LinkButton runat="server" CssClass="linkbutton1" id="TiedostoLB"  text='<%# DataBinder.Eval(Container.DataItem, "Tiedosto") %>' /></ItemTemplate>

The text-partition renders in to

href="javascript:__doPostBack('ctl00$ContentPH$LiitetiedotDG$ctl03$TiedostoLB','')"> file.pdf</a>

I tried making it a HyperLink, but NavigateUrl="<%# DataBinder.Eval(Container.DataItem, "Tiedosto") %>" renders to just the filename and not the path. How do I either fix the LinkButton to open in a new window (with some javascript:window.open() I presume) or get the HyperLink to function (which I would prefer)

4

0 回答 0