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
Ramesh BabuPosted Aug 7, 2014, 6:29 AM
how to call like this
http://localhost:2181/swot/VIEW/1002
it's for partial view,
Sasi ReddyPosted Oct 21, 2013, 7:36 AM
I have a model and controller.
Jaganathan BantheswaranPosted Oct 21, 2013, 7:32 AM
Can u please upload the project itself because whatever you uploaded is confusing me.
delete the packages & bin folders and upload
Jaganathan BantheswaranPosted Oct 21, 2013, 6:11 AM
Sasi ReddyPosted Oct 21, 2013, 6:02 AM
No SIr.I am getting same error.Once again thank u for giving me reply
Jaganathan BantheswaranPosted Oct 21, 2013, 5:56 AM
you have to return IEnumerable
Do something like,
return View(new List
Sasi ReddyPosted Oct 21, 2013, 5:51 AM
Jaganathan BantheswaranPosted Oct 21, 2013, 5:46 AM
@model IEnumerable
So please return view with an empty object like,
return View(new DBLayer.Models.IdentityAccountDetail()) ;
Sasi ReddyPosted Oct 21, 2013, 5:30 AM
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 BantheswaranPosted Oct 21, 2013, 5:24 AM
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 ReddyPosted Oct 21, 2013, 5:18 AM
Jaganathan BantheswaranPosted Oct 21, 2013, 5:16 AM
On which line you are getting error?
Sasi ReddyPosted Oct 21, 2013, 5:07 AM
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 BantheswaranPosted Oct 21, 2013, 4:47 AM
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 )