asp.net-mvc-3-areas

pass model from one action to another action in same controller

删除回忆录丶 提交于 2020-01-03 09:04:39
问题 I am trying to pass my model List< Models.Statement > statementList from one action to another but i am receiving null value in the 2nd controller. Please suggest what is wrong here. Even tried with: return RedirectToAction("WriteInTemplate", new { statementList = statementList }); Please help. public ActionResult SendPdfStatement(string InvoiceNumber) { try { InvoiceNumber = InvoiceNumber.Trim(); ObjectParameter[] parameters = new ObjectParameter[1]; parameters[0] = new ObjectParameter(

pass model from one action to another action in same controller

孤者浪人 提交于 2020-01-03 09:04:03
问题 I am trying to pass my model List< Models.Statement > statementList from one action to another but i am receiving null value in the 2nd controller. Please suggest what is wrong here. Even tried with: return RedirectToAction("WriteInTemplate", new { statementList = statementList }); Please help. public ActionResult SendPdfStatement(string InvoiceNumber) { try { InvoiceNumber = InvoiceNumber.Trim(); ObjectParameter[] parameters = new ObjectParameter[1]; parameters[0] = new ObjectParameter(

How to specify route to shared views in MVC3 when using Areas

坚强是说给别人听的谎言 提交于 2019-12-25 17:16:23
问题 I have an MVC3/Razor app using Areas such that my views are in the following location: /Areas/Areaname/Views/ControllerName/view.cshtml Right now, for any shared partials, I have to put them here: /Views/Shared/_sharedview.cshtml I would prefer to have my shared views here: /Areas/Shared/Views/_sharedvew.cshtml Is there a way to tell the view engine to look somewhere other than the default location for shared views? I am thinking something like this: routes.MapRoute("Shared", "Areas/Shared

Routing - Area Controller/View with parameter

点点圈 提交于 2019-12-24 11:09:02
问题 Super simple MVC site with an Area to handle mobile devices. All of my Area routing works fine with the exception of a view that expects a parameter. In the "normal" site I have a view video page that expects a parameter. mysite.com/Video/123456 This works perfectly. After fighting this for a bit in my Area for the mobile content I have even gone down to using the exact same code/markup in my Controller and View. So I would expect that the following URL: mysite.com/Mobile/Video/123456 Would

HighCharts — MVC 3 Database

时光总嘲笑我的痴心妄想 提交于 2019-12-12 08:55:43
问题 I am working with DotNet.Highcharts in Visual Studio 2010. I am creating a MVC 3 Web Application. I am able to get HighCharts working by statically assigning the data. I would like to be able to send the data from a database to HighCharts for displaying. Can I create a class to control the data and then send the class to HighCharts? If so, can anyone tell me how to do this? Also, if someone has a working project that demonstrates this and is willing to share that would be awesome. I saw

MVC3 RouteHandler result ignores Area in the resolved Route - why?

元气小坏坏 提交于 2019-12-12 02:41:22
问题 I am working on splitting an MVC3 Application into two Areas. The existing application is going into one area (V1) and we are beginning a redesign in the second area (V2). I have the Views, Models, Controllers, etc all moved into the MyApp\Areas\V1\xxx folders, and I have been able to verify that things are loading as they should for the most part. I moved all the Route registration for V1 into the V1AreaRegistration.cs file, and modified it to use context.MapRoute instead of RouteTable

mvc3 - using partial views in a different area

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 12:19:38
问题 I have two questions regarding partial views... When to use Partial views vs @helper methods, i have used both interchangeably and would like to get more consistent in their usage. What do you guys do? How do you reference a partial view from another area. I have an area called admin and i have a partial view in the regular Views directory. How do i use it .. i have tried the following which dont work as it cant be found. @Html.Partial(VirtualPathUtility.ToAbsolute("~/Views/ControllerName/

HighCharts — MVC 3 Database

我们两清 提交于 2019-12-04 11:03:23
I am working with DotNet.Highcharts in Visual Studio 2010. I am creating a MVC 3 Web Application. I am able to get HighCharts working by statically assigning the data. I would like to be able to send the data from a database to HighCharts for displaying. Can I create a class to control the data and then send the class to HighCharts? If so, can anyone tell me how to do this? Also, if someone has a working project that demonstrates this and is willing to share that would be awesome. I saw someone posted the below class in another question. however, I don't know how to use it or send the class to

MVC Areas for enterprise - good or bad? [closed]

雨燕双飞 提交于 2019-12-04 08:25:31
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . Within a single project solution introducing Areas when you have a lot of controllers does improve separation and allows modules to easily be copied in or out of the solution. However in a large enterprise solution I would favour splitting the logic into separate projects

ASP.NET MVC 3 Areas and multiple authentication in web.config

送分小仙女□ 提交于 2019-12-03 23:55:10
问题 I have been attempting to follow this blog to get Areas working: http://mstechkb.blogspot.com/2010/10/areas-in-aspnet-mvc-20.html In the blog post, it identifies the ability to have authentication set per Area, e.g.: <location path="Area1"> <system.web> <authentication mode="Windows" /> <authorization> <allow roles="role1,role2"/> <deny users="*"/> </authorization> </system.web> </location> However, when I try to create this in a new project in Visual Studio 2010 I get the following error