Hello,
I am using the following code below, which aims to open a new window whenever the user clicks on column Name rows in the gridview. However, I can not get the code to work and on the client-side, the click functionality is inactive.
<script type="text/javascript">
function popItUp(querystring) {
window.open('About.aspx' + querystring);
}
</script>
<asp:GridView ID="gv" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource2" OnRowDataBound="gv_RowDataBound">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="column1" HeaderText="column1"
SortExpression="column1" />
<asp:BoundField DataField="priceTalk" HeaderText="priceTalk"
SortExpression="priceTalk" />
<asp:BoundField DataField="Decimal_price" HeaderText="Decimal_price"
SortExpression="Decimal_price" />
<asp:BoundField DataField="Cover" HeaderText="Cover" SortExpression="Cover" />
<asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" />
<asp:BoundField DataField="UploadDate" HeaderText="UploadDate"
SortExpression="UploadDate" />
</Columns>
</asp:GridView>
Updated working solution:
<asp:TemplateField HeaderText="Deal_Name">
<ItemTemplate>
<a href="java<!-- no -->script:popup('About.aspx?id=<%#Eval("Deal_name")%>&designation=<%#Eval("Deal_name")%>&a=d')"><%#Eval("Deal_name")%></a>
</ItemTemplate>
</asp:TemplateField>
function popup(url) {
popupWindow = window.open(url, 'popupWindow', 'heigh=700,width=900,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,direction=no,status=yes')
}
Any help would be appreciated.
Many thanks for your time and help.