Instead of passing parameters, use properties, that way you can set the
properties after you use the LoadControl method. You'll have to create a
reference as the actual type though instead of the base Control class in
order to set the properties correctly.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"Sabri AKIN" <an*******@discussions.microsoft.com> wrote in message
news:2c****************************@phx.gbl...
thanks,
its work fine but i have to pass parameter to ascx file
like orderID.
how can i pass parameter to this webcontrol page with
this code.
-----Original Message-----
Sabri:
You can do something like this:
Control c = Page.LoadControl("x.ascx");
StringWriter sw = new StringWriter();
HtmlTextWriter writer = new HtmlTextWriter(sw) ;
string contents = null;
try{
c.RenderControl(writer);
contents = sw.GetStringBuilder().ToString();
}finally{
sw.Close();
writer.Close();
}
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Sabri AKIN" <an*******@discussions.microsoft.com> wrote
in messagenews:22****************************@phx.gbl... Hi,
I want to send ascx file's html code as email.this ascx
file is summary of customer sale.and at last iwant to
send email to customer.how can i get and past ascx file's html code to mail body.
.