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
First Last
NA
648
72.3k
ViewBag and/or Tempdata not showing
Aug 6 2020 12:39 PM
I hard code values into the ViewBag and TempData but they do NOT show in the view.
Why?
I am NOT redirecting, just rendering - returning the view name with a model class.
Part of the BlogPublishedSelectionCriteria.cshtml view:
@model GbngWebClient.Models.BlogPublishedSelectionCriteriaVM
<h2 class="page-header">Blog Selection Criteria</h2>
@{
Layout = "~/Views/Shared/_LayoutUser.cshtml";
}
<p class="alert alert-danger" id="errorMessage">@TempData["errormessage"]</p>
<p class="alert alert-danger" id="errorMessage2">@ViewBag.errormessage</p>
The last part of the action method before returning the view:
ViewBag.errormessage = "test";
TempData["errormessage"] = "test";
return View("BlogPublishedSelectionCriteria", blogPublishedSelectionCriteriaVM);
Reply
Answers (
3
)
How to get URL for your crystalreport download?
I can not able to update one column