I have a gridview whose one column has value file name and that column is shown as a button or linkbutton i could use anything . Now i want to pass the text of this button to javascript function and then in javascript function i will pass that value to window.open(). How shall i do it below is my code
<Columns>
<asp:BoundField HeaderText="CNAID" ItemStyle-Width="10%" DataField="CNAID" SortExpression="CNAID"/>
<asp:BoundField HeaderText="CDRID" ItemStyle-Width="10%" DataField="CDRID" SortExpression="CDRID"/>
<asp:BoundField HeaderText="CNATypeID" ItemStyle-Width="10%" DataField="CNATypeID" SortExpression="CNATypeID"/>
<asp:TemplateField HeaderText="FileName" SortExpression="FileName">
<ItemTemplate>
<asp:Button name ="abc" ID="lnkname" runat="server" Text='<%#Eval("FileName") %>' CommandArgument='<%#Eval("FileName") %>'
onClientclick = "javascript:return myFunction();" >
</asp:Button>
and my javascript function is
function myFunction() {
window.open("http://www.w3schools.com");
return false;
}