I have declared a variable in code behind
the variable name is progressbar which is of int type
to access this variable in the same asp.net page i am using this code
<table align="center" border="1" cellpadding="0" cellspacing="0" frame="border"
style="border-color: #FF0000" width="100%">
<tr>
<td bgcolor="#FF0066" colspan="0" rowspan="0" width="<%= progressbar %>%">
</td>
<td colspan="0" rowspan="0">
</td>
</tr>
i have used both <%= progressbar %> and <%# progressbar %> but not able to access this variable.
Can you tell me how can I access this variable from c# code behind to the asp.net page
All variables in C# are local variables, and they’re only visible inside the function they were declared in. Make your thing a field or a property instead, and make sure it’s either
protectedorpublic.