Declaring a string globally in C#
<p>In the below rough sample code of C# I have to declared a string in condition and I am unable to access it out of that brace</p>

<pre><code>if(//some condition)
{
string value1 = "something";
}
//push to database value1
</code></pre>

<p>In the above code compiler says <code>The name 'value1' does not exists in the current context</code> I need the <code>value1</code> to be declared in such a way that it must be accessed in whole page. I tried <code>protected value1</code> but that too didn't work. I hate to use it as a separate class. Is there anyway to declare globally?</p>
