1. Declare your variables as public
public string amount, paymentid, paymentname, paymentaddress, paymentcity, paymentstate, paymentzip, paymentmobile, paymentemail;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["PaymentID"] != null)
{
amount = Session["gvtotal"].ToString();
paymentid = Session["direct_pay_id"].ToString();
paymentname = Session["paymentname"].ToString();
paymentaddress = Session["paymentaddress"].ToString();
paymentcity = Session["paymentcity"].ToString();
paymentstate = Session["paymentstate"].ToString();
paymentzip = Session["paymentzip"].ToString();
paymentmobile = Session["paymentmobile"].ToString();
paymentemail = Session["paymentemail"].ToString();
}
else
{
Response.Redirect("default.aspx");
}
}
2. In the aspx page,
value="<%=paymentname %>