单击网格视图中的链接时如何显示aspx页面。
我有一个effort.aspx页面,在网格视图中我有一个链接按钮
< asp:LinkButton 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