Popup window from asp:Hyperlink with two parameters


Here is a working sample for a popup window with two parameters:

C#:

<asp:TemplateField HeaderText="NamePop">
<ItemTemplate>
<asp:HyperLink runat="server"  ID="HyperLinkpopup"  NavigateUrl= <%#"javascript:_popupWin=window.open(
'btest.aspx?Sample_ID=" + Eval("Sample_ID") + "&Count_ID="+ Eval("Count_ID") +"','_popupWin',
'width=300,height=300,resizable=yes,location=yes,scrollbars=yes');_popupWin.focus()" %>
 Text='<%# Eval("Speciescode")+ "---" + Eval("Species")%>'></asp:HyperLink>
                        </ItemTemplate>
 </asp:TemplateField>
VB.NET:
 
<asp:TemplateField HeaderText="NamePop">
 <ItemTemplate>
 <asp:HyperLink runat="server"  ID="HyperLinkpopup"  NavigateUrl= 
<%#"javascript:_popupWin=window.open('btest.aspx?Sample_ID=" & Eval("Sample_ID") & "&Count_ID=" & Eval("Count_ID") 
& "','_popupWin','width=300,height=300,resizable=yes,location=yes,scrollbars=yes');_popupWin.focus()" %>
     Text='<%# Eval("Speciescode")& "---" & Eval("Species")%>'></asp:HyperLink>
 </ItemTemplate>
</asp:TemplateField>

  

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s