How do I perform a cross-page post using the postbackurl property?

How do I perform a cross-page post using the postbackurl property?

The following code example demonstrates how to use the PostBackUrl property to perform a cross-page post. When the user clicks the Button control, the page posts the value entered in the text box to the target page specified by the PostBackUrl property.

What is cross page posting in ASP NET?

In this article you will learn what Cross Page Posting in ASP.NET is. By default, buttons have a postback property. When you click the button it reloads the page itself. However we can use the property PostBackUrl to redirect to another page.

Why does my postback post back to itself?

If you do not specify a value for the PostBackUrl property, the page posts back to itself. When performing a cross-page postback with controls with server-side validation, you should check that the page’s IsValid property is true before processing the postback. In the case of a cross-page postback, the page to check is the PreviousPage.

How does postback url work with button control?

When the user clicks the Button control, the page posts the value entered in the text box to the target page specified by the PostBackUrl property. To run this sample, you must also create a file for the target page in the same directory as this code example. The code for target page is provided in the next example.

What is cross-page posting?

This is referred to as cross-page posting. Cross-page posting provides some advantages over using the Transfer method to redirect to another page. For details, see Redirecting Users to Another Page. Show activity on this post. Cross – page posting is targeting a different page from the original page.

What is a postback button?

By default, buttons and other controls that cause a postback on an ASP.NET Web page submit the page back to itself. This is part of the round-trip cycle that ASP.NET Web pages go through as part of their normal processing. For details, see Introduction to ASP.NET Web Pages.

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top