Hi all,
I'm new to ASPX programming so please forgive me if this is simple.
I'm trying to create a page that has several buttons on it and I want to have a single subroutine to handle all of the button clicks. I want to pass "CommandName" and "CommandArgument" parameters to the subroutine but when I code this up I get a "Server Runtime Error" when I click on a button.
Any help would be greatly appreciated.
Thanks,
Ken
Here's my code:
I'm new to ASPX programming so please forgive me if this is simple.
I'm trying to create a page that has several buttons on it and I want to have a single subroutine to handle all of the button clicks. I want to pass "CommandName" and "CommandArgument" parameters to the subroutine but when I code this up I get a "Server Runtime Error" when I click on a button.
Any help would be greatly appreciated.
Thanks,
Ken
Here's my code:
Code:
Protected Sub Button_Click(ByVal sender As Object, ByVal e As CommandEventArgs) Response.Write("Button_Click: " & e.CommandArgument) End Sub
PHP Code:
<asp:Button ID="Button1" runat="server" Text="Open" onclick="Button_Click" CommandArgument="open" CommandName="router" />
<asp:Button ID="Button2" runat="server" Text="Close" onclick="Button_Click" CommandArgument="open" CommandName="router" />
Comment