protected void lnkotel1_Click(object sender, EventArgs e)
{
Session["xd"] = lblotelid1.Text;
Server.Transfer("~/otelsayfa.aspx");
Response.Redirect("otelsayfa.aspx?id=" + lblotelid1.Text);
}
protected void Page_Load(object sender, EventArgs e)
{
lblotelid.Text = Session["xd"].ToString();
var last = PreviousPage;
if (last != null)
{
lblotelid.Text = ((TextBox)last.FindControl("TextBox1")).Text;
}
else
{
lblotelid.Text = "no";
}
if (Request.QueryString.Get("id") == null)
{
lblotelid.Text = "no";
}
else
{
lblotelid.Text = Request.QueryString["id"].ToString();
}
I tried 3 different variation but all of them have failed. Here is the events after i run this codes one by one:
1st code: I get an error message says: System.Web.SessionState.HttpSessionState.this[string].get, null
2nd code: blank page
3rd code: "no"(because of else condition). If i remove else condition i get same error message as 1st code.
I am trying to solve this for days now. And I cant find any flaws. I honostly appreciate any kind of help now.
edit: I can transfer data from .master page to any .aspx page without any problem. But from .aspx page to diffirent .aspx page, it is just impossible. There is no way.