ASP.NET PostBackUrl Property

Definition and Usage

The PostBackUrl property is used to get or set the URL of the target page to be posted back when the LinkButton control is clicked.

Syntax

<asp:LinkButton PostBackUrl="string" runat="server" />
Property Description
string String value. Specifies the URL of the target page to be sent. The default is an empty string, which causes the page to post back to itself.

Example

The following example sets the post URL for the LinkButton control:

<form runat="server">
  Name:<asp:TextBox id="TextBox1" runat=Server />
  <asp:LinkButton id="Button1" Text="Submit" 
  PostBackUrl="demo_postbackurl.aspx" runat="Server" />
</form>

Example

Set the PostBackUrl Property of the LinkButton Control