Could you please tell me how to create partial views and call in another pages plz its very urgent
I followed this link http://mvc4beginner.com/Tutorial/MVC-Partial-Views.html
but it is giving error here
@Html.Partial("../Views/Home/PartialView1.cshtml",DBLayer .Models .IdentityAccountDetail )
Loading

Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Oct 21, 2013, 12:47 AM EDT
Partial views should be under Shared folder & should start with _. i.e _PartialView1.cshtml.
Try like this.
@Html.Partial("~/Views/Home/PartialView1.cshtml", DBLayer .Models .IdentityAccountDetail )
Sasi ReddyRank #4,458 · 342 reputationPosted Oct 21, 2013, 1:07 AM EDT
view name is _View1
@model IEnumerable
I created the partial view in Shared folder
I called like this
could you please tell me how to solve this?..........
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Oct 21, 2013, 1:16 AM EDT
On which line you are getting error?
Sasi ReddyRank #4,458 · 342 reputationPosted Oct 21, 2013, 1:18 AM EDT
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Oct 21, 2013, 1:24 AM EDT
Make sure your are returning IdentityAccountDetail object from your Controller like
return View(object of IdentityAccountDetail );
you are not retuning IdentityAccountDetail from controller it seems. Thats why Model is Null.
Sasi ReddyRank #4,458 · 342 reputationPosted Oct 21, 2013, 1:30 AM EDT
i have so many functions .In that ,I have two create functions.one is not contains any arguments and returns return view()
and another create function contains object as argument and it returns like return view(identityaccountdetails)
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Oct 21, 2013, 1:46 AM EDT
@model IEnumerable
So please return view with an empty object like,
return View(new DBLayer.Models.IdentityAccountDetail()) ;
Sasi ReddyRank #4,458 · 342 reputationPosted Oct 21, 2013, 1:51 AM EDT
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Oct 21, 2013, 1:56 AM EDT
you have to return IEnumerable
Do something like,
return View(new List
Sasi ReddyRank #4,458 · 342 reputationPosted Oct 21, 2013, 2:02 AM EDT
No SIr.I am getting same error.Once again thank u for giving me reply
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Oct 21, 2013, 2:11 AM EDT
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Oct 21, 2013, 3:32 AM EDT
Can u please upload the project itself because whatever you uploaded is confusing me.
delete the packages & bin folders and upload
Sasi ReddyRank #4,458 · 342 reputationPosted Oct 21, 2013, 3:36 AM EDT
I have a model and controller.
Ramesh Babu8 reputationPosted Aug 7, 2014, 2:29 AM EDT
how to call like this
http://localhost:2181/swot/VIEW/1002
it's for partial view,