i want to pass session value from aspx page to .html page
i have one aspx page and 1 .html page i want to pass session value of aspx page to textbox of html page.. how can i do that can anyone send me code
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Francis SusaimichaelPosted Sep 29, 2015, 7:27 AM
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="DemoWebForm.WebForm1" %>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Session["MySession"] = "MySessionVariable";
Response.Redirect(String.Concat("HtmlPage.html?myval=", Convert.ToString(Session["MySession"])));
}
}
}
Francis SusaimichaelPosted Oct 5, 2015, 1:38 AM
Monica BundelPosted Oct 3, 2015, 12:23 AM
Francis SusaimichaelPosted Oct 1, 2015, 5:46 AM
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="DemoWebForm.Login" %>
Login.aspx.cs
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace DemoWebForm
{
public partial class Login : System.Web.UI.Page
{
protected void btnLogin_Click(object sender, EventArgs e)
{
// Store the user name
Session["UserName"] = txtUserName.Text;
Response.Redirect(String.Concat("HtmlPage.html?uname=", Convert.ToString(Session["UserName"])));
}
}
}
Monica BundelPosted Oct 1, 2015, 4:40 AM
Francis SusaimichaelPosted Sep 30, 2015, 5:47 AM
Monica BundelPosted Sep 30, 2015, 2:05 AM
Manas MohapatraPosted Sep 29, 2015, 5:10 AM
Upendra Pratap ShahiPosted Sep 29, 2015, 5:04 AM