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
prasanna p
980
470
103.9k
Viewbag null condition check giving error in the view
Jan 13 2020 11:44 AM
Hi Friends, I am assigning value in the controller like this. [HttpPost] public Actionresult order(FormColletion formcollection) { Viewbag.startes = formcollection ["starters"]; return view(); } Value of my viewbag is : gobi Manchuria,chicken 65 In my view What I am doing is @if(Viewbag.startes !=null) { @foreach(var data in (string)viewbag.starters.split(',')) //assigning data values here } Now my question is if viewbag not contains values giving @symbol error if I remove null check condition giving object reference error. What is the solution for this issue??
Reply
Answers (
1
)
GST Billing Software with source code in Asp.net
i am facing problem during build my asp.net mvc application