<in*******@hotmail.com> wrote in message
news:a8**************************@posting.google.c om...
Hi
In the lbtnSubmit1_Click, lbtnSubmit2_Click , lbtnSubmit3_Click ,etc
of my .aspx form , I want to store the sender in the session , so I
can call again the click method at some other point X in the code. At
point X, I just want to call something like sender.click.
How can I do that?
Why do you want to put the sender into Session? Do you need to access it on
another page?
If you just want to use it on the same page, you can use a delegate:
public class MyPage : System.Web.UI.Page
{
...
private EventHandler currentClickEvent;
...
private void btnSubmit1_Click(object sender, EventArgs e)
{
...
currentClickEvent = new EventHandler(btnSubmit1_Click);
}
// Same for the other two Click handlers
...
private void SomeLaterMethod()
{
currentClickEvent();
}
}
--
John Saunders
johnwsaundersiii at hotmail