Passing variables to same page without query string
<p>I want to change my code below so that I don't have to use query strings. I want to set two variables <code>yesID</code> and <code>noID</code>. I'm navigating from <code>default.aspx</code> to the same page <code>default.aspx</code>. Is this possible? If so how?</p>

<pre><code>//get query string
if (Request.QueryString["yesId"] != null &amp;&amp; Request.QueryString["noId"] != null)
{
    int yesPictureId = Convert.ToInt32(Request.QueryString["yesId"]);
    int noPictureId = Convert.ToInt32(Request.QueryString["noId"]);

    //Set rated image Items to Visible
    RatedImage.Visible = true;
    HyperLink1.Visible = true;
    RatedPicRating.Visible = true;

    //pass ratings to database
    Ratings PassRatings = new Ratings();
    PassRatings.InsertRatings(yesPictureId, 1);
    PassRatings.InsertRatings(noPictureId, 2);

    //Get total yes and nos and Do Calculation 
    Ratings GetNoVotes = new Ratings();
    int DATotalYesVotes = GetNoVotes.GetTotalNOVotes(1, yesPictureId);
    int DaTNoVotes = GetNoVotes.GetTotalNOVotes(2, yesPictureId);
    int DaTotalVotes = DATotalYesVotes + DaTNoVotes;
    double Percentage = ((double)DATotalYesVotes / (double)DaTotalVotes) * 100;
    //Round percentage
    Percentage = Math.Round(Percentage, MidpointRounding.AwayFromZero);

    //Insert New percentage
    Picture UpdatePictureTating = new Picture();
    UpdatePictureTating.UpdateRatings(yesPictureId, (int)Percentage);

    //Create pictue object
    Picture RatedPic = new Picture();
    DataTable DARatedPicture = RatedPic.GetRatedPicByQueryString(yesPictureId);

    //Assign Location and Rating to variables
    foreach (DataRow row in DARatedPicture.Rows)
    {
        // firstRatedPicId = row["PicID"].ToString();
        //secondNoPicId = firstYesPicId;
        //holds member Id for profile link
        int MemberID = (int)row["MemberID"];
        RatedPicnameLabel.Text = row["MemberName"].ToString() + "'s profile";
        HyperLink1.NavigateUrl = "Member.aspx?UserID=" + MemberID;
        RatedPicRating.Text = "Banged Rating: " + row["PicRating"].ToString() + "%";
        RatedImage.ImageUrl = "Pictures/" + row["PicLoc"];
        RatedImage.PostBackUrl = "Member.aspx?UserID=" + MemberID;
    }

}
else
{
    //If we dont have any ratied pictures hide those elements
    RatedImage.Visible = false;
    HyperLink1.Visible = false;
    RatedPicRating.Visible = false;
}
</code></pre>

<p>I'm setting the variables below. I don't want to use a query string though.</p>

<pre><code>FirstPicLink.PostBackUrl = "default.aspx?yesId=" + firstYesPicId + "&amp;noId=" + firstNoPicId;
SecondPicLink.PostBackUrl = "default.aspx?yesId=" + secondYesPicId + "&amp;noId=" + secondNoPicId;
</code></pre>

<p>I'm thinking something like this. But how do I store those variables? Won't they be lost once the page is reloaded.</p>

<pre><code>yesID = 1
NoID = 2
FirstPicLink.PostBackUrl = "default.aspx";
SecondPicLink.PostBackUrl = "default.aspx";
</code></pre>
