I have a GridView Template field containing an ASP:Label field which has a unique reference number per Row. I also have an open Javascript function assigned to that control which opens a URL in a new window and displays the document of the same reference number.
I don;t know how to obtain the reference number when the user clicks the LinkButton on a particular row, and pass it to my Javascript function before the window opens.
Code:
enter code here
function openPreview()
{
var url = "quotereport.aspx?view=esq&&ref=REFNUMBER"; window.open(url);
}
<asp:TemplateField HeaderText="" ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="lbNewWindow" runat="server" OnClientClick="openPreview ()">Window</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
Any help would be much appreciated.