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
Darshan Kshirasagar
NA
22
3k
Index was outside the bounds of the array.
Oct 24 2016 5:24 AM
public class K1<br />{<br /> public K1()<br /> {<br /> I1Value = new I1[] { };<br /> }<br /><br /> private I1[] I1Value;<br /><br /> public I1[] K1_Method<br /> {<br /> get<br /> {<br /> return this.I1Value;<br /> }<br /> set<br /> {<br /> this.I1Value = value;<br /> }<br /> }<br />}<br />public class I1<br />{<br /> public I1()<br /> {<br /> Cd = new InstCode();<br /> }<br /> private InstCode cdField;<br /><br /> private string instField;<br /><br /> public InstCode Cd<br /> {<br /> get<br /> {<br /> return this.cdField;<br /> }<br /> set<br /> {<br /> this.cdField = value;<br /> }<br /> }<br /> public string InstrInf<br /> {<br /> get<br /> {<br /> return this.instField;<br /> }<br /> set<br /> {<br /> this.instField = value;<br /> }<br /> }<br />}<br /><br />public enum InstCode<br />{<br /> A,<br /> B,<br /> C,<br /> D,<br /><div>} </div><div> protected void Page_Load(object sender, EventArgs e)<br /> {<br /> try<br /> {<br /> <br /> K1 objK1 = new K1();<br /> <br /> objK1.K1_Method[0].Cd = ((InstCode)Enum.Parse(typeof(InstCode), "D"));<br /> //objK1.K1_Method.<br /> }<br /> catch (Exception ex)<br /> {<br /><br /> }<br /> }</div><div> </div><div> As Above code when i,m trying to access the objK1.K1_Method[0].Cd = ((InstCode)Enum.Parse(typeof(InstCode), "D")); showing idex outside error how can i set .</div><div> </div><div> </div>
Reply
Answers (
1
)
How to pass the data from view to other view in MVC 4?
Array type how to create object