Greetings, I am working on a gridview that contains an asp:hyperlink TemplateField. When clicked, I would like it to trigger a popup window. Here is an example of my javascript code.
<script>
function openPopup(url) {
newWindow = window.open(url, 'name', 'height=300,width=735');
if (window.focus) { newWindow.focus() }
return false;
}
</script>
Below is the non-popup version of the code.
<ItemTemplate>
<asp:HyperLink Target="_blank" DataNavigateUrlFields="PriceListItemID" ID="lnkQty" runat="server" DataNavigateUrlFormatString="../PricingTool/PriceListQuantity.aspx?PriceListItemID={0}" Text='<%# Bind("NumQty") %>' NavigateUrl='<%# "../PricingTool/PriceListQuantity.aspx?PriceListItemID=" + Eval("PriceListItemID") %>' />
</ItemTemplate>
I have tried different approaches but keep getting the error "The server tag is not well formed." Here is an example of the broken code I attempted.
<asp:HyperLink Target="_blank" DataNavigateUrlFields="PriceListItemID" ID="lnkQty" runat="server" Text='<%# Bind("NumQty") %>' NavigateUrl='<%# "Javascript:openPopup.show('../PricingTool/PriceListQuantity.aspx?PriceListItemID=" + Eval("PriceListItemID").ToString() + "')" %>' />
Any assistance with this issue would be highly appreciated.