单击网格视图中的链接时如何显示aspx页面。 [英] How to display aspx page when a link in grid view is clicked.

查看:58
本文介绍了单击网格视图中的链接时如何显示aspx页面。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个effort.aspx页面,在网格视图中我有一个链接按钮

< asp:LinkBut​​ton ID =lnkEffortsText ='<%#Eval([TotalEfforts] )%>'

runat =server/>

单击按钮时,我需要一个弹出窗口,即TotalEffort.aspx,它包含一个带有两列的网格视图。

一个是显示名称的标签< asp:Label ID =lblNameText ='<%#Eval([Name])%>'runat = 服务器 >和一个输入工作的文本框

以及提交和取消按钮。

我需要在effort.aspx.vb中编写代码以显示TotalEfforts.aspx单击链接按钮。

I have a effort.aspx page where in grid view I have a link button
<asp:LinkButton ID="lnkEfforts" Text='<%#Eval("[TotalEfforts]")%>'
runat="server"/>
When the button is clicked I need a pop up window which is TotalEffort.aspx and it contains a grid view with two columns.
One is label to display name <asp:Label ID="lblName" Text='<%#Eval("[Name]")%>' runat="server"> and a text box to enter the effort
And a submit and cancel button.
I need a code to be written in effort.aspx.vb to display TotalEfforts.aspx when the link button is clicked.

推荐答案

在ASPX页面中:

In ASPX Page:
<asp:LinkButton ID="lnkEfforts" Text='<%#Eval("[TotalEfforts]")%>'

runat="server" OnClick="LinkButton_Click" />



在Codebehine页面(C#):


In Codebehine Page(C#):

protected void LinkButton_Click(Object sender, EventArgs e)
{
    string url = "TotalEffort.aspx";
    string s = "window.open('" + url + "', 'popup_window', 'width=300,height=100,left=100,top=100,resizable=yes');";
    ClientScript.RegisterStartupScript(this.GetType(), "script", s, true);
}



在Codebehine页面(VB):


In Codebehine Page(VB):

Protected Sub LinkButton_Click(sender As [Object], e As EventArgs)
    Dim url As String = "TotalEffort.aspx"
    Dim s As String = (Convert.ToString("window.open('") & url) + "', 'popup_window', 'width=300,height=100,left=100,top=100,resizable=yes');"
    ClientScript.RegisterStartupScript(Me.[GetType](), "script", s, True)
End Sub



这里我设置高度,宽度 - 您可以根据您的要求进行设置。


Here I set height, width - you can set as per your requirement.


请通过以下链接



http://stackoverflow.com/questions/23426821/to-open-a-popup-window-on-clicking-link-button-in-grid-view [ ^ ]







希望有所帮助
Please go through the link below

http://stackoverflow.com/questions/23426821/to-open-a-popup-window-on-clicking-link-button-in-grid-view[^]



Hope it helps


这篇关于单击网格视图中的链接时如何显示aspx页面。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆