Hi kavithav,
Refer the below sample.
HTML
<div>
<table>
<tr>
<td>
<asp:TextBox ID="txtValue" runat="server" />
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" Text="Generate Random Number" runat="server" OnClick="GenerateRandomNumber" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label1" runat="server" />
</td>
</tr>
</table>
</div>
Code
C#
protected void GenerateRandomNumber(object sender, EventArgs e)
{
string number = "";
Random random = new Random();
if (!string.IsNullOrEmpty(txtValue.Text.Trim()))
{
for (int i = 0; i < Convert.ToInt32(txtValue.Text.Trim()); i++)
{
int n = random.Next(0, 100000);
number += n.ToString("D5") + "<br/>";
}
}
Label1.Text = number;
}
VB.Net
Protected Sub GenerateRandomNumber(sender As Object, e As EventArgs)
Dim number As String = ""
Dim random As New Random()
If Not String.IsNullOrEmpty(txtValue.Text.Trim()) Then
For i As Integer = 0 To Convert.ToInt32(txtValue.Text.Trim()) - 1
Dim n As Integer = random.[Next](0, 100000)
number += n.ToString("D5") + "<br/>"
Next
End If
Label1.Text = number
End Sub
Screenshot