I have made this using asp 3.0 maybe this will work on ASP.Net
try this one.
<%
'Generate Unique Random Numbers
Dim ctrLoop,flagVal,rndNum,arryLoop,storageVal(255),fn dLoop,statArray,countDown(10),setCount
ctrLoop=1
setCount=1
for arryLoop=1 to 100
if ctrLoop<>11 then
RS.MoveFirst
flagVal=0
Randomize
rndNum=int(50*Rnd())+1
storageVal(arryLoop) = rndNum
statArray=arryLoop-1
if rndNum<51 then
for fndLoop=1 to statArray
if storageVal(arryLoop)=storageVal(fndLoop) then flagVal=1
next
else
'greater than 50
end if
if flagVal=0 then
'Response.Write rndNum & "<br>"
countDown(setCount)=rndNum-1
setCount=setCount+1
ctrLoop=ctrLoop+1
else
'flagVal is 0
end if
else
'Reached 10 items
end if
Next
%>
|