2
Answers

How to select constant text string randomly from fixed no of strings?

jayanand kamble

jayanand kamble

15y
3.6k
1
Hi

There are some fixed no of text string say :

public const string Str1 = "Text1";
public const string Str2 = "Text2";
.......

In the aspx page, there is a submit button. When user clicks it, a text message will be selected randomly to display as a label from those text string.

How should I write that random selection part of the C# code?

Thanks

Answers (2)