2
Reply

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

jayanand kamble

jayanand kamble

Apr 10 2009 2:14 AM
3.6k
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)