1
Answer

How to hide view bag data in cshtml in mvc 5 razor

Photo of prabhu p

prabhu p

5y
869
1
@Html.Partial("_Pharmacyinfo",(string)@ViewBag.Sourcepage) , I am passing this partial view from main view with view bag data,functionality working fine for me. but in main view Viewbag data dispalying at the end of the page.
 
if i removed the this line @Html.Partial("_Pharmacyinfo",(string)@ViewBag.Sourcepage)
from page that viewbag data render in cshtml get removed so i want to know how to pass a viewbag data without render in cshtml 

Answers (1)