spark-view-engine

Setting the Checked property of a CheckBox in ASP.NET MVC

戏子无情 提交于 2019-12-05 01:45:25
问题 I'm trying to work around the lack of a CheckBoxList in ASP.NET MVC. I've gotten to the point I can render a list of Enum values just fine, but I'm stuck on how to set the checked attribute based on my Model - Which in this case is a User entity that has an IList of Role entities. The role id's correspond to the enum values. This example is using the Spark View Engine syntax, but it's functionally identical to the standard ASP.NET MVC view engine ("$(" is the same as "<%=" or "<%") <for each=

Cannot use Html.ActionLink in asp.net mvc spark files

≡放荡痞女 提交于 2019-12-04 07:59:33
I'm using the spark view engine with my asp.net mvc application. In my aspx pages, I can succesfully use Html.Actionlink, but when I attempt it in spark files, it doesnt show up in intellisense, and when i try to run it anyway, i get: Dynamic view compilation failed. c:\Users\midas\Documents\Visual Studio 2008\Projects\ChurchMVC\ChurchMVC\Views\Home\Index.spark(73,25): error CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using

ASP.NET MVC Email

核能气质少年 提交于 2019-12-04 07:41:59
问题 Is their a solution to generate an email template using an ASP.NET MVC View without having to jump through hoops. Let me elaborate jumping through hoops. var fakeContext = new HttpContext(HttpContext.Current.Request, fakeResponse); var oldContext = HttpContext.Current; HttpContext.Current = fakeContext; var html = new HtmlHelper(new ViewContext(fakeControllerContext, new FakeView(), viewDataDictionary, new TempDataDictionary()), new ViewPage()); html.RenderPartial(viewName, viewData,

To Spark or not to Spark?

筅森魡賤 提交于 2019-12-04 01:12:21
Been on a huge learning binge with ASP.MVC 2 lately, and recently uncovered there are different rendering engines out there... Spark especially caught my attention, couple of things though. I have vast knowledge with ASP.NET so is it worth the ramp up, in addition to ASP.NET MVC Is it worth it in general? Does it really matter? It seems to be a preference of taste really and not so much performance or even a substantial reduction in developer time. It still seems immature, not very good intellisense support, syntax highlighting support, not many tooling options. It has preliminary support for

ASP.NET MVC View Engine Resolution Sequence

…衆ロ難τιáo~ 提交于 2019-12-03 12:17:38
I created a simple ASP.NET MVC version 1.0 application. I have a ProductController which has one action Index. In the view, I created a corresponding Index.aspx under Product subfolder. Then I referenced the Spark dll and created Index.spark under the same Product view folder. The Application_Start looks like protected void Application_Start() { RegisterRoutes(RouteTable.Routes); ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new Spark.Web.Mvc.SparkViewFactory()); ViewEngines.Engines.Add(new WebFormViewEngine()); } My expectation is that since the Spark engine registers before default

Creating a 'website builder' - How would I architect it? [closed]

别来无恙 提交于 2019-12-03 10:01:29
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I've been tasked with adding a website builder to our suite of applications. Most of our clients are non technical small business owners (brick and mortar stores, mom and pop shops). I've been told that I should be looking at Blogger Template Editor and trying to see if I can make

ASP.NET MVC Email

做~自己de王妃 提交于 2019-12-02 15:18:43
Is their a solution to generate an email template using an ASP.NET MVC View without having to jump through hoops. Let me elaborate jumping through hoops. var fakeContext = new HttpContext(HttpContext.Current.Request, fakeResponse); var oldContext = HttpContext.Current; HttpContext.Current = fakeContext; var html = new HtmlHelper(new ViewContext(fakeControllerContext, new FakeView(), viewDataDictionary, new TempDataDictionary()), new ViewPage()); html.RenderPartial(viewName, viewData, viewDataDictionary); HttpContext.Current = oldContext; The above code is using the current HttpContext to fake

Removing master layout from view (MVC2)

戏子无情 提交于 2019-12-02 07:28:20
if i need remove master layout from my view, how can i do it in MVC2? i tried put code in my view that was shown in documentation http://sparkviewengine.com/documentation/master-layouts : , but it still bring my Application.spark layout :-/ any ideas why? Not tested, but what if you create and empty master layout, and say <use master="EmptyMaster" /> in the top of your view? Or you could call on the empty master from the controller; return View("View", "EmptyMaster"); Don't know if it'll work, but it's worth a shot. I know this answer is a litle (maybe a lot) late but you can also use the

Will the Spark view engine interoperate with webforms master pages?

梦想与她 提交于 2019-12-02 03:50:35
I really like Spark, but we've already got a big investment in webforms based views. I'd like to start using Spark without having to convert all my existing views up front. The only problem I have with getting Spark working side by side with webforms is the master pages. Currenly I have spark layouts that are 1 for 1 duplicates of the master pages. This amount of duplication isn't acceptable. I've already been bitten by it several times. Is there any way to get spark views to work within a webforms master? Or for a webforms view to work within a spark layout? Either would solve the duplication

Simple ASP.NET MVC views without writing a controller

我们两清 提交于 2019-11-30 18:42:42
We're building a site that will have very minimal code, it's mostly just going to be a bunch of static pages served up. I know over time that will change and we'll want to swap in more dynamic information, so I've decided to go ahead and build a web application using ASP.NET MVC2 and the Spark view engine. There will be a couple of controllers that will have to do actual work (like in the /products area), but most of it will be static. I want my designer to be able to build and modify the site without having to ask me to write a new controller or route every time they decide to add or move a