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
Shah Shishir
NA
4
0
Index was outside the bounds of the array in asp.net using c#
Oct 10 2008 3:16 AM
Dear sir,
When i load / run my application this code at that time i m gatting this error in code.
Error := Index was outside the bounds of the array. so i think my code is somewhere wrong. so plz correct my code and help me as early as possible..hear i give my code.
Code
======================================
string PathToFolder = Server.MapPath("~/banners/" + Label2.Text);
string[] RotatingImgFiles = Directory.GetFiles(PathToFolder);
Random Rnd = new Random();
int n = new Random().Next(0,Count);
FileInfo file = new FileInfo(RotatingImgFiles[Rnd.Next(0,n)]);
bannerimage.ImageUrl = ("~/banners/" + Label2.Text + "/" + file.Name);
===============================================
So plz help me as early as possible.
Thanks with regards in advance.
[ Shah Shishir.]
Prasnet.net Pvt. Ltd.
Ahmedabad.
Reply
Answers (
0
)
Question about controls! (New to VS 2008, Not new to coding)
web hangman