Default.aspx code
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
string url;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Session["a"] = txt_username.Text.ToString();
Session["b"] = txt_password.Text.ToString();
Response.Redirect("screen.aspx");
}
}
screen.aspx code
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Session["a"].ToString();
Label1.Text = Session["b"].ToString();
}
}
Design page
Default.aspx design page
Session.aspx design page
when i run default.aspx and click the button
the following error occurs
the resource cannot be found.
please help me. i want to retreive the username and password of default.aspx to session.aspx page using session please help me.
and send the correct code.what is wrong in my above code.