What's the purpose of using PostBackUrl?
Let's say I have a button which is in Cart.aspx:
<asp:Button ID="btnContinue" runat="server" Text="Continue Shopping" PostBackUrl="~/Order.aspx" CssClass="btn" />
That means that I will be redirectd to Order.aspx, rather than staying on original Cart.aspx. Here are my two questions:
I also have a
TextBoxin Cart.aspx.
When I click thebutton, the value of theTextBoxwill be posted back to Order.aspx rather than original Cart.aspx. Now I think we can only get this value if it is posted back to Cart.aspx, which contains thisTextBox.
What if I want to retrieve this value on the new page?If there is no way to retrieve any input on Cart.aspx, why do we need to use PostBackUrl? We could just add:
Response.Redirect("~/Order.aspx")to the Cart.aspx.cs?