<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="Default" %>
Testing Server.Execute
File: Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.IO;
using System.Web;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
StringBuilder builder = new StringBuilder();
builder.Append("Response generated before Execute is called
");
StringWriter writer = new StringWriter();
Server.Execute("child.aspx", writer);
builder.Append(writer.ToString());
builder.Append("
Response generated after the call to Execute.");
Label1.Text = builder.ToString();
}
}
File: child.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="Child" %>
child.aspx
File: child.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
public partial class Child : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Response generated by child.aspx");
}
}