Handle page refresh in asp.net
<pre><code>private Boolean IsPageRefresh = false;
    protected void Page_Load(object sender, EventArgs e)
    {        
        if (!IsPostBack)
        {
            ViewState["postids"] = System.Guid.NewGuid().ToString();
            Session["postid"] = ViewState["postids"].ToString();
            TextBox1.Text = "Hi";
    }
    else
    {
        if (ViewState["postids"].ToString() != Session["postid"].ToString())
        {
            IsPageRefresh = true;
        }
        Session["postid"] = System.Guid.NewGuid().ToString();
        ViewState["postids"] = Session["postid"];
    }
}
protected void Button1_Click(object sender, EventArgs e)
{
    if (!IsPageRefresh) // check that page is not refreshed by browser.
    {
        TextBox2.Text = TextBox1.Text + "@";

    }
}
</code></pre>

<p>i found this solution and its working for me.Buddy i could not understand  that when page submitted then view state variable and session variable is same and after that i refresh page then view state and session variable have differt values while last time they have same value.</p>
