MemberHome.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MemberHome.aspx.cs" Inherits="FacePamphlet.Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<asp:Button ID="btnFriendInfo" runat="server" OnClick="btnFriendInfo_Click" Text="Friend Info" />
</div>
</form>
</body>
</html>
The file "MemberHome.aspx.cs "
using System;
namespace FacePamphlet
{
public partial class Default : System.Web.UI.Page
{
/// <summary>
/// the global "Email" string variable in a query string to the "MemberHome.aspx" Web page
/// </summary>
public static string Email;
protected void Page_Load(object sender, EventArgs e)
{
Email = "test@gmail.com";
}
protected void btnFriendInfo_Click(object sender, EventArgs e)
{
Response.Redirect("FriendInfo.aspx");
}
}
}
The file "FriendInfo.aspx"
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FriendInfo.aspx.cs" Inherits="FacePamphlet.FriendInfo" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit" />
<br />
<asp:Label ID="lblEmail" runat="server" Text="Email"></asp:Label>
</div>
</form>
</body>
</html>
The file "FriendInfo.aspx.cs":
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FacePamphlet
{
public partial class FriendInfo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
lblEmail.Text = Default.Email;
}
}
}
Example:
Comments
Leave a comment