I have created one Httphandler in that HttpHandler i have to load a composite control. I tried below but it does not work anyone have a clue how to load composite control(which is a dll) in Httphandler? I know how to load a aspx or user control(axcx) page
using PageParser.GetCompiledPageInstance but i want to load a composite control. Also I tried creating page and put htmlform control inside and add composite control in Htmlform and add that Web Page in context of HttpHandler but doing that why does not fire
the events of composite control.
Anyone can please help me how to add a composite control in Httphandler and also have to make them event fire?
Alkingson
0 Points
6 Posts
Composite control inside httphander
Dec 03, 2010 03:44 AM|LINK
Hi,
I have created one Httphandler in that HttpHandler i have to load a composite control. I tried below but it does not work anyone have a clue how to load composite control(which is a dll) in Httphandler? I know how to load a aspx or user control(axcx) page using PageParser.GetCompiledPageInstance but i want to load a composite control. Also I tried creating page and put htmlform control inside and add composite control in Htmlform and add that Web Page in context of HttpHandler but doing that why does not fire the events of composite control.
Anyone can please help me how to add a composite control in Httphandler and also have to make them event fire?
public virtual void ProcessRequest(HttpContext context)
//test
HtmlTextWriter writer = new HtmlTextWriter(context.Response.Output);
"<html><head><base target=\"_self\"></head>");
"<body style='border:0;background-color:gainsboro;' leftmargin='0' topmargin='0'>");
"<form id='form1' runat='server'>");
WebControl c = new DemoControl();
//HtmlForm fm = new HtmlForm();
//fm.Controls.Add(c);
this.Controls.Add(c);
//Below is two line how i load my aspx page but i dont want to load physical aspx page i want to load a composite control not a ascx or aspx page.
//Page userControl = (Page)PageParser.GetCompiledPageInstance("~/Control.aspx", context.Server.MapPath("~/Control.aspx"), context);
//userControl.ProcessRequest(context);
////////////////////////////////////
writer.Write(
"</form></body></html>");
//Panel p = iHandler.GetControl();
//GetControl();
//this.Form.Controls.Add(iHandler.GetControl());
}
Thanks,
Alkingson
httphandler composite control
Jerry Weng -...
All-Star
29527 Points
3488 Posts
Re: Composite control inside httphander
Dec 27, 2010 02:22 AM|LINK
Hi,
Did you get the solution? I see that you have resolved this thread.
Alkingson
0 Points
6 Posts
Re: Composite control inside httphander
Jan 11, 2011 09:09 PM|LINK
Yes i did got the answer..