I'm working on my very first ASP.NET MVC project, and I'm seeing strange behavior when returning data from an Edit View to my controller action.
Right now, I have 3 textboxes on the page, plus one hidden one for the PKey. All are being populated from the viewdata correctly, but when I submit the form, only 2 of the 3 fields show up in ...
I am playing with Sparkview 1.0 on ASP.NET 4.0 with MVC2. Trying to create a simple HTML form.
When the form loads, it renders as expected. Click Save button on the form, the model validates, returns an error about length of field (expected) but then the !{ Model.Name } tag gets rendered as the text ${ Model.Name } rather than the actua...
I am getting an error when I use it like this
!{Html.RenderAction("Action", "Controller")}
I had to switch to webforms view engine and replace it with
<% Html.RenderAction("Action", "Nav"); %>
to get it to work.
The error I am getting is "Cannot convert void to char"
...
Hi,
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?
...
Hi 2 all,
Does omebody has ideas how to fix "Method not found: 'Void System.Web.Mvc.ViewContext..ctor(System.Web.Mvc.ControllerContext, System.Web.Mvc.IView, System.Web.Mvc.ViewDataDictionary, System.Web.Mvc.TempDataDictionary)'." exception. This solution doesn't work http://dotnetslackers.com/articles/aspnet/installing-the-spark-view-e...
How can I prevent the Spark view engine from rendering the debugging hint when a null ref exception is thrown in !{ }? It always renders "${ expression.that.throws.nre }". The documentation states that it should render an empty string... it never mentions the behavior I'm experiencing. Using settings.SetDebug(false) doesn't change this b...
How to increase editor responsiveness when typing code for Spark View Engine?
Spark plugin for VS08 takes lot of CPU resources as it checks the syntax of all Spark files on each key stroke: does anyone have an idea how to optimize this?
...
All,
Doing some experimenting with Spark and MVC within NerdDinner. The normal/aspx view works well, and I haven't touched any of the controller code so I'm pretty sure it's not that.
<viewdata model="System.Collections.Generic.IEnumerable[[NerdDinner.Models.Dinner]]"/>
<set Title="'Upcoming Dinners'"/>
<content:main>
<li each="p i...
Hello,
I'm currently trying to get MVC2 and Spark to work happily. Everything
looks great, however I can't for the life of me get Html.BeginForm to
write out the form tags. My code is:
#Html.BeginForm();
<div>
<fieldset>
<legend>Account Information</legend>
<div class="editor-label">
${Html.LabelFor(m => m.UserNam...
<% using (Html.BeginForm("AddToCart", "Cart")) { %>
<%= Html.Hidden("ProductID", pr.ProductID) %>
<%= Html.Hidden("returnUrl", ViewContext.HttpContext.Request.Url.PathAndQuery) %>
<input type="submit" value="+ Add to cart" />
<% } %>
Currently I am using
# using (Html.BeginForm("AddToCart", "Cart")) {
${Html....
Is it possible to use multiple view engines? I have a large(ish) site that is already using the webforms view engine, but we would like to move to spark for new features.
Is this supported? any documentation online that details how to do this?
...
Is it possible to use my site.master master page ? I want to start using Spark more, but this project I am working on is using asp.net view pages as well.
I could of course convert the master page to an application.spark page, but I was wondering if it is at all possible to use the Site.Master I already have.
...
I'm trying to use SparkView engine with ASP.NET MVC running on a Linux machine, but there seems to be known problems resolving view paths eg:
System.InvalidOperationException: The view 'Index' or its master could not be found. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.asp...
I can't seem to get a grasp on how to use the viewdata structure in the spark view engine. I have the following code in my controller:
// Retrieve the project list from the database
var projects = from p in _context.Repository<project>()
orderby p.name ascending
select p;
...
Given a spark view named SomeContainer.spark that uses a partial view this way:
<SomeContent param1 = "Model.SomeValue"/>
and given a partial view named SomeContent.spark that uses the parameter this way:
<div>${param1}</div>
How can I modify SomeContent.spark to declare param1 upfront. I want to do that for two reasons:
Readabil...
Building or publishing my ASP.MVC 2 application the .spark files in the View directories copied to /bin/Views/*.
This redundancy seems to be useless as the app runs fine on the server even if I delete the bin/Views directory.
Any idea how to prevent this behavior?
My files are tagged with the default build action "Content" and the Vi...
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 ...
I use Spark to output some HTML straight from a console app. I have the following view classes in my project.
//A shared view that all other views should use
public abstract class SharedView : AbstractSparkView
{
public string BasePath = string.Empty;
}
public abstract class ApplicationView : SharedView
{
public Application App...
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 Applic...
Ive got a project that has got an application.spark and a html.spark that contains all the masterpage markup. The views work fine, but I need to create an isolated page that has no relation at all with the masterpages. Is it possible or will I need to have another nested masterpage?
Thanks
...