I created 2 div's inside a view.
to display content inside that i have used partial view and to show errors i am using Viewbag and displayed it as follows:
<div id="tabs">
<ul>
<li><a href="#tabs-1">Publish Exhibition</a></li>
<li><a href="#tabs-2">Edit Existing Exhibition</a></li>
</ul>
<div id="tabs-1" style=" width:900px; height:400px;">
<font color="red">@ViewBag.msg1</font>
@{Html.RenderPartial("PubExhi", Model);}
</div>
<div id="tabs-2">
@{Html.RenderPartial("EditExhi");}
</div>
</div>
I'm calling this view as
ViewBag.msg1 = "record not updated!!!!";
modelList = setIndex();
return View("Index", modelList);
evry thing is working fine except the viewbag
it is not displaying any msgs
When i debugged it, i can see the viewbag containing appropriate value
but it is not displaying on the page
I also tried to display it from the partial view but not getting any message
Can any body help me
Best Answer
Use
@Html.Raw(ViewBag.msg1)
to display.....