M
Mike
Hi,
I have question that I think should I know the answer to but don't.
In my ASP.NET file, default.aspx I have the following code.
<asp:Button id="Mday1" OnClick="Mday_Click" Text="+" Runat="server"
CommandName="Mday1"></asp:Button>
<asp:Button id="Mday2" OnClick="Mday_Click" Text="+" Runat="server"
CommandName="Mday2"></asp:Button>
in my code behind file, default.aspx.cs I have the following function
protected void Mday_Click(object sender, System.EventArgs e)
{
string debug = null, cname=null;
debug = "You clicked control" + cname;
}
When I click either button on the web page it finds the event, (By
setting a breakpoint I know it has). What I want to know is which of
the buttons it came from. Is this possible or am I asking the wrong
question?
When I am debugging (in Visual Studio) by looking 'into' the sender ->
System.Web.UI.WebControls.Button -> CommandName I can see what the
command name is. How do I get this CommandName?
Any help greatly appreciated.
Mike
I have question that I think should I know the answer to but don't.
In my ASP.NET file, default.aspx I have the following code.
<asp:Button id="Mday1" OnClick="Mday_Click" Text="+" Runat="server"
CommandName="Mday1"></asp:Button>
<asp:Button id="Mday2" OnClick="Mday_Click" Text="+" Runat="server"
CommandName="Mday2"></asp:Button>
in my code behind file, default.aspx.cs I have the following function
protected void Mday_Click(object sender, System.EventArgs e)
{
string debug = null, cname=null;
debug = "You clicked control" + cname;
}
When I click either button on the web page it finds the event, (By
setting a breakpoint I know it has). What I want to know is which of
the buttons it came from. Is this possible or am I asking the wrong
question?
When I am debugging (in Visual Studio) by looking 'into' the sender ->
System.Web.UI.WebControls.Button -> CommandName I can see what the
command name is. How do I get this CommandName?
Any help greatly appreciated.
Mike