Tuesday, April 7, 2009

How to get output of one aspx page from another aspx page in asp.net using C# Code.

In Your aspx Page you.

(1).Import
using System.IO;
using System.Text;

(2).Use Server.Execute method.

protected void Page_Load(object sender, EventArgs e)
{
StringWriter strWriter = new StringWriter();
Server.Execute("~/Login.aspx", strWriter, false);
string str = strWriter.ToString();
}

variable str will contains Whole Html Output of Login.aspx page.

Thanks..

No comments:

Post a Comment

Comments posted on ASP.Net Ajax Tutorials Blog are moderated and will be approved only if they are on-topic and not abusive. Please email me or my team for tech-support or blogging related questions. Avoid including website URLs in your comments - Thanks Author