<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
End Sub
Sub CommandButton_Click(Sender As Object, E As CommandEventArgs)
lblButtonPressed.Text = "You pressed: " _
& E.CommandName & "<BR>With this argument: " _
& E.CommandArgument & "<BR>"
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Creating a Basic LinkButton Control</TITLE>
</HEAD>
<form runat="server">
<asp:label
id="lblButtonPressed"
runat="server"
/>
<BR><BR>
<asp:linkbutton
id="lnkbutSortName"
text="Sort By Name"
oncommand="CommandButton_Click"
commandname="Sort"
commandargument="By Name"
runat="server"
/>
<BR><BR>
<asp:linkbutton
id="lnkbutSortPrice"
text="Sort By Price"
oncommand="CommandButton_Click"
commandname="Sort"
commandargument="By Price"
runat="server"
/>
<BR><BR>
<asp:linkbutton
id="lnkbutNewSearch"
text="New Search"
oncommand="CommandButton_Click"
commandname="New Search"
commandargument="None"
runat="server"
/>
</form>
</BODY>
</HTML>
|