# Example of Server.Transfer and Context Handler

**URL:** <https://forum.kirupa.com/t/example-of-server-transfer-and-context-handler/239401>\
**Category:** Uncategorized\
**Created:** [September 21, 2007, 10:51am UTC](https://forum.kirupa.com/t/example-of-server-transfer-and-context-handler/239401 "2007-09-21T10:51:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanusoft](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hanusoft](https://forum.kirupa.com/u/hanusoft)\
**Post date:** [September 21, 2007, 10:51am UTC](https://forum.kirupa.com/t/example-of-server-transfer-and-context-handler/239401/1 "2007-09-21T10:51:26Z")

</div>

This is an example of Server.Transfer and Context Handler.  
Through this we can get the multiple values of previous form.

> **[Managed Services Consultants | Hanu Software Solutions, Inc.](https://hanusoftware.com/)**
>
> Hanu helps all types of customers by accelerating innovation with truly custom Azure-based cloud services. Contact Us Today to Learn More.

In this page we are displaying data from previous form. We can use this technique for multiple form registration form.

Code (ContextParent.aspx.cs): -

private void Button1\_Click(object sender,System.EventArgs e)  
{  
Server.Transfer(“ContextChild.aspx”);  
}

```
    internal Hashtable Value
    {
        get
        {
            Hashtable objHT = new Hashtable();
            objHT["Name"]=TextBox1.Text;
            objHT["FathersName"]= TextBox2.Text;
            objHT["Address"] = TextBox3.Text;
            return objHT;
        }
    }

```

Code (ContextChild.aspx.cs) :-

private void Page\_Load(object sender, System.EventArgs e)  
{  
// Put user code to initialize the page here  
Hashtable objHT = new Hashtable();  
if(!IsPostBack)  
{  
ContextParent ParentPage;  
ParentPage = (ContextParent)Context.Handler;  
objHT = ParentPage.Value;  
Response.Write("\<br\>\<br\>");  
foreach(DictionaryEntry di in objHT)  
{  
Response.Write(di.Key +" : “+di.Value);  
Response.Write(”\<br\>");  
}  
}  
}
