asp button postbackurl (C#)
<%@ Page Language="C#" %>
<html>
<head id="Head1" runat="server">
<title>Button Search</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label
id="lblSearch"
Text="Search:"
Runat="server" />
<asp:TextBox
id="txtSearch"
Runat="server" />
<asp:Button
id="btnSearch"
Text="Go!"
PostBackUrl="ButtonSearchResults.aspx"
Runat="server" />
</div>
</form>
</body>
</html>
<%--
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load()
{
if (PreviousPage != null)
{
TextBox txtSearch = (TextBox)PreviousPage.FindControl("txtSearch");
lblSearch.Text = String.Format("Search For: {0}", txtSearch.Text);
}
}
</script>
<html>
<head>
<title>Button Search Results</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label
id="lblSearch"
Runat="server" />
</div>
</form>
</body>
</html>
--%>
Related examples in the same category