//namespace
using System.Text;
using System.IO;
Control c = Page.LoadControl("WebUserControl.ascx");
((UserControlBaseSoloDesign)c).function(string username)//function in webusercontrol.ascx for displaying in ascx page
form1.Controls.Add(c); //form 1 is the control in the page
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();
}
Response.Write(contents.ToString());
Monday, August 10, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment