Hi Indradeo,
Please refer below sample.
HTML
Default
<table>
<tr><td>Name:<asp:TextBox ID="txtName" runat="server" ></asp:TextBox></td></tr>
<tr><td>Country:<asp:TextBox ID="txtCountry" runat="server" ></asp:TextBox></td></tr>
<tr><td><asp:Button ID="btnSend" runat="server" Text="Send" OnClick="Send"/></td></tr>
</table>
Home
<asp:Label ID="lblName" runat="server"></asp:Label><br />
<asp:Label ID="lblCountry" runat="server"></asp:Label>
Code
C#
Class
public class Customer
{
public string Name { get; set; }
public string Country { get; set; }
}
Default
protected void Send(object sender, EventArgs e)
{
Customer customer = new Customer();
customer.Name = txtName.Text;
customer.Country = txtCountry.Text;
Session["Data"] = customer;
Response.Redirect("Home.aspx");
}
Home
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
Customer customer = Session["Data"] as Customer;
lblName.Text = customer.Name;
lblCountry.Text = customer.Country;
}
}
VB.Net
Class
Public Class Customer
Public Property Name As String
Public Property Country As String
End Class
Default
Protected Sub Send(ByVal sender As Object, ByVal e As EventArgs)
Dim customer As Customer = New Customer()
customer.Name = txtName.Text
customer.Country = txtCountry.Text
Session("Data") = customer
Response.Redirect("Home.aspx")
End Sub
Home
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not Me.IsPostBack Then
Dim customer As Customer = TryCast(Session("Data"), Customer)
lblName.Text = customer.Name
lblCountry.Text = customer.Country
End If
End Sub
Screenshot