取得 PostBackUrl 轉來的網頁資料

摘要:取得 PostBackUrl 轉來的網頁資料

 

-------------------------------------------A 網頁----------------------------------------------------

 

 <asp:Button ID="Button1" runat="server" Text="A1" OnClick="Button1_Click" PostBackUrl="~/shopping/addCommodity.aspx"/>

-------------------------------------------A 網頁----------------------------------------------------

public partial class shopping_ManageCommodity : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {}

    protected void Button1_Click(object send, EventArgs e)
    { }

    public string GetString() 

 { 

        string strTemp = TextBox1.Text; 

        return strTemp; 

 } 


}

-------------------------------------------B 網頁----------------------------------------------------

<%@ PreviousPageType VirtualPath="~/shopping/ManageCommodity.aspx" %>

-------------------------------------------B 網頁----------------------------------------------------

       // Label1.Text = ((shopping_ManageCommodity)PreviousPage).GetTextBox; 
        Label1.Text = PreviousPage.GetString();