是否可以添加多个前一页标签,例如
<%@ PreviousPageType VirtualPath="~/Default3.aspx" %>
<%@ PreviousPageType VirtualPath="~/Default3.aspx" %>
默认3.aspx:
<asp:GridView ID="grdexample" runat="server"
AutoGenerateColumns="False" onrowcommand="grdexample_RowCommand">
<Columns>
<asp:TemplateField>
<ItemTemplate>
**<asp:LinkButton ID="lnkbtn" runat="server" Text="Edit" PostBackUrl="~/Default4.aspx" />**
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Name" DataField="ActMasNm" />
<asp:BoundField HeaderText="ID" DataField="ActMasId" />
<asp:TemplateField>
<ItemTemplate>
<asp:HiddenField ID="hdnso" runat="server" Value='<%# Eval("ActMasId") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
默认3.cs:
public string id { get; set; }
protected void grdexample_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridViewRow gvrw = (GridViewRow)((Control)e.CommandSource).Parent.Parent;<br>
int rwIndex = gvrw.RowIndex;<br>
HiddenField hdn = (HiddenField)gvrw.FindControl("hdnso");<br>
id = hdn.Value;
}
默认4.aspx:
< PreviousPageType VirtualPath="~/Default3.aspx" >
Default4.cs
TextBox1.Text = this.PreviousPage.id;
上面的代码工作正常,我的问题是,如果Default4.apsx
从Default1.aspx
我如何获取 id 调用这个页面?