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: 
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.
A general solution in Java.

```
 public static int rand(int min, int max) {
    int range = max - min + 1;
    int num = 1;
    do {
          num = num * 100 + getrand100();
    } while (num <= range);
    return min + num % range;
 }

```

Btw writing code on an iPhone isn't easy ;)