Page p = BuildManager.CreateInstanceFromVirtualPath("/" + "test.aspx", typeof(Page)) as Page;
((IHttpHandler)p).ProcessRequest(HttpContext.Current);
ControlCollection lCollection = p.Controls;
Which is working a expected but the page which I am calling in that virtual path is getting added to the current page, how can I stop adding this.
The other one I tried is
Which is working a expected but the page which I am calling in that virtual path is getting added to the current page, how can I stop adding this.
The other one I tried is
string filePath = System.Web.HttpContext.Current.Request.PhysicalApplicationPath;
filePath = filePath + "test.aspx";
using (StreamReader sr = new StreamReader(filePath))
{
MessageBody = sr.ReadToEnd();
}
From the MessageBody I need to list out all the controls using some Regex, is this possible can some one help me to achieve my task
From the MessageBody I need to list out all the controls using some Regex, is this possible can some one help me to achieve my task


Answers
Know the answer? Post it. Somebody with the same question will find it here.