【发布时间】:2010-06-04 06:17:41
【问题描述】:
我希望在 Windows 资源管理器(或 explorer.exe)中打开 Gridview 中的链接。
<asp:GridView ID="GridView1"runat="server" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="DeploymentLocation" runat="server" CommandName="OpenLink"
Text='<%# Eval("DeploymentLocation") %>' CommandArgument='<%# Eval("DeploymentLocation") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
在代码隐藏中我有这个:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
Process.Start("explorer.exe", "/n," + e.CommandArgument.ToString());
}
显然这不起作用,因为 Process.Start 仅在我拥有完全权限等情况下才有效。我听说我可以使用 Javascript 来执行此操作,但到目前为止还没有成功。 基本上,我想要的是单击时要打开的网格中显示的确切链接。任何帮助将不胜感激!
谢谢!
【问题讨论】:
标签: c# asp.net javascript gridview asp.net-2.0