Sorry, No code snippets found.

Comments or Responses

Posted by: Ajaygohil on: 3/15/2019 Level:Starter | Status: [Member] | Points: 10
the ViewBag and ViewData is same to work pass the data controller to view but in ViewBag in type casting is not required and the ViewData is required for typecasting and checks for null values to avoid errors. In your example the output is both same print "asdsa" but in viewbag you can simply pass the sanjay but in viewdata pass with square break with double quotation.

Login to post response