TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
anjumathi kumar
NA
54
64.2k
C# Question
Jul 5 2011 2:01 AM
Hi
In a popup i have a multiline textbox .in that i type five names like
mahi
moni
soni
suji
krish
if i give ok mean it want to store temporary variable using array list
and want to select any one name using random function..
i tried this coding
{
a2.Add(item);
rno1 = randmname.Next(a2.Count);
rno2 = a2[rno1].ToString();
}
private
static
int
rno, rno1;
private
static
string
rno2;
private
string
stringToArrayList(
string
MyValue)
{
ArrayList
a2 =
new
ArrayList
();
string
[] s = MyValue.Split(
new
char
[] {
','
});
foreach
(
string
item
in
s)
a2.Add(item);
Random
randmname =
new
Random
();
rno1 = randmname.Next(a2.Count);
rno2 = a2[rno1].ToString();
return
rno2;
}
i am passing my textbox.textcontent in this function.
here am getting like all names mahimonisonisujikrish in single line
but i want to generate random names from this list
how can i change
Reply
Answers (
1
)
Word Document in C#
How to hold values generated from javascript function during post back in asp.net