Question: I'm new to C# .NET. I would like to ask how this works... What I want is just to show an age selection from 1 to 100.

Inside the `.aspx` file I put this code, I used data binding for the variable `listAge`.

```
<asp:DropDownList ID="AgeDropDown" runat="server">
     <%# listAge %>
</asp:DropDownList>

```

Here's the code-behind for it:

```
protected void Page_Load(object sender, EventArgs e)
{            
    for (int i = 1; i < 101; i++)
    {
        string listAge;
        listAge = "<asp:ListItem>"+ i +"</asp:ListItem>";
    }
}

```

The error shown inside the `.aspx` is:

> 
> *Error Creating Control: `AgeDropDown` - Code blocks are not supported in this context.*
> 
> 
> 

Because of the variable `listAge`?

Thank you for the help!

Answer: 
You could use the server version of `AgeDropDown`.

```
ListItem li;
for (int i = 1; i < 101; i++)
{
    li = new ListItem(i.ToString(), i.ToString());
    AgeDropDown.Items.Add(li);
}

```
Is this in asp.net or MVC?

Probably

... <%# listAge %>

should be 

... <%= listAge %>