How do I define a variable for use everywhere
<p>According to below code , after getting some value (newrev,newreview) and putting in the variable, I need to put them in the label ("some text"+newrev). But I have problem (newrev) does not exist in current context.</p>

<pre><code>Label1.Text = "Review Number:" + newReview + "(for preparing of Rev." + newrev+")";

protected void ddlProjectDocument_SelectedIndexChanged(object sender, EventArgs e)
{
    _DataContext = new EDMSDataContext();

    var x = ddlProjectDocument.SelectedValue;

    var MaxRev = (from rev in _DataContext.tblTransmittalls
                  where rev.DocID.ToString() == ddlProjectDocument.SelectedValue
                  select  rev.REV).Max();

    if (MaxRev == null)
    {
        var newRev = 0;

    }

    else
    {

        var newRev = Convert.ToInt32(MaxRev) + 1;

    }

    var MaxReview = (from rev in _DataContext.tblFiles
                  where (rev.DocId.ToString()==ddlProjectDocument.SelectedValue)&amp;&amp;   
                        (rev.Rev.ToString()==MaxRev)
                  select rev.Review).Max();

    if (MaxReview == null)
    {
        var newReview = 1;
    }

    else
    {    
        var newReview = Convert.ToInt32(MaxReview) + 1;
    }

    Label1.Text = "Review Number:" + newReview + "(for preparing of Rev." + newrev+")";
}
</code></pre>
