M
MattNC
Hi, I'd appreciate any help with this. I'm new to this so I'll need
things spelled out. I have a web form that creates an XML document when
it is submitted. The code behind has the event handler, everything
works fine. But I'm trying to also write a cookie on the OnClick event.
How do I add a second handler to one event? I've tried:
private void InitializeComponent(){
this.submitBtn.Click += new System.EventHandler(this.SubmitLead,
this.MakeCookie);
}
The first handler works great, but the second one does nothing. Here's
my code for the MakeCookie method:
public void MakeCookie(object sender, System.EventArgs e){
HttpCookie MyCookie = new HttpCookie("clientco");
MyCookie.Value = "submitted";
DateTime dt = DateTime.Now;
TimeSpan ts = new TimeSpan(100,30,0,0,0);
MyCookie.Expires = dt + ts;
Response.Cookies.Add(MyCookie);
}
Thanks!
things spelled out. I have a web form that creates an XML document when
it is submitted. The code behind has the event handler, everything
works fine. But I'm trying to also write a cookie on the OnClick event.
How do I add a second handler to one event? I've tried:
private void InitializeComponent(){
this.submitBtn.Click += new System.EventHandler(this.SubmitLead,
this.MakeCookie);
}
The first handler works great, but the second one does nothing. Here's
my code for the MakeCookie method:
public void MakeCookie(object sender, System.EventArgs e){
HttpCookie MyCookie = new HttpCookie("clientco");
MyCookie.Value = "submitted";
DateTime dt = DateTime.Now;
TimeSpan ts = new TimeSpan(100,30,0,0,0);
MyCookie.Expires = dt + ts;
Response.Cookies.Add(MyCookie);
}
Thanks!