Question: I have UL in my page, and it is empty.
I start populating it with LI using javascript.

How can I use this newly added dynamic data in the asp.net in the postback phase?

that is because my submit button is asp.net control.
I do not want to use JS POST.

thanks

Answer: 
I would propose

```
1 + getrand100() % 20 

```

for the first case (20) and

```
(getrand100()%2)*100 + getrand100()

```

for the latter (200).
In c++:

```
if (getrand100() % 2) return getrand100();
else return getrand100() + 100;

```

Half the time it will return a number in the range 1-100 (the `if` statement) and the other half of the time it will return a number in the range 101-200 (the `else` statement). You could also (as pointed out in the comments) do any similar condition such as `getrand100() <= 50`.

In fact, you could speed up your 1-20 answer by doing:

```
return (getrand100() % 20) + 1;

```

This way, you don't have to keep rejecting out of range solutions.