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
Gaurav Kapahi
NA
182
0
How to return 2 grids data on one Action Result in MVC
Oct 22 2013 3:06 AM
View
@{Html.RenderPartial("BattingGridPartial", Model.Batting);
@{Html.RenderPartial("BowlingGridPartial", Model.Bowling);
Controller
[HttpPost]
public ActionResult LoadGrid()
{
var Model = new ICCEntities();
Model = null;
try
{
string r;
r = Session["Report"].ToString();
IEnumerable<string> SelectedReportId = r.Split(',');
IEnumerator<string> ReportIds = SelectedReportId.GetEnumerator();
while (ReportIds.MoveNext())
{
if (ReportIds.Current == "1")
{
Model = new ICCEntities();
Session["ReportId"] = "1";
Model.Batting = GetList();
}
if (ReportIds.Current == "2")
{
Session["ReportId"] = "2";
Model.Bowling = GetList();
}
}
catch
{
}
return View(Model);
}
Model
public List<IDictionary> Batting { get; set; }
public List<IDictionary> Bowling { get; set; }
I am able to fetch data in to Model in controller but it is not returning any grid in view... On load it is giving me error
object reference is null
in Model.Bowling in View, Please Help me in Same
Reply
Answers (
1
)
windows form
c#