简体   繁体   English

在GridView中使用HyperlinkField传递参数并打开一个弹出窗口

[英]Passing a paramater using HyperlinkField inside a GridView and opening a popup

Im having an issue passing a parameter using HyperLinkField inside a Gridview while opening a popup. 我在打开弹出窗口时在Gridview中使用HyperLinkField传递参数时遇到问题。 I need to pass 2 paramaters in the URL, how can I let it know about it? 我需要在URL中传递2个参数,如何让它知道呢?

This is what I currently have: 这是我目前拥有的:

<asp:HyperLinkField Text="Details" NavigateURL="javascript:var w =window.open('ProviderDetailPop.aspx','details','width=520,height=560,left=450,top=150,menubar=no,location=no,resizable=yes,scrollbars=no,status=yes,toolbar=no')" />

You need to construct your NavigateURL value using String.Format and pass your parameters. 您需要使用String.Format构造NavigateURL值并传递参数。 A rough example is below 下面是一个粗糙的例子

<asp:HyperLink ID="lnkEmployee" runat="server" Text='<%# Eval("Employee") %>' NavigateUrl='<%# String.Format("~/yourPage.aspx?p={0}", Eval("ID")) %>' />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM