Error - MVC Application tries to render .aspx, not .spark

2 views
Skip to first unread message

jba...@googlemail.com

unread,
Jun 27, 2010, 6:43:42 PM6/27/10
to Spark View Engine Dev
Hello,

I'm trying to set up my first MVC Application using Spark. But I can't
get it to work. For some reason, my Application still looks for .aspx
views to render, and ignores the .spark files. What am I doing wrong?
Here's how I set upthe Spark engine:

protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterRoutes(RouteTable.Routes);
ViewEngines.Engines.Add(new SparkViewFactory());
}

ViewEngines.Engines.Add(new SparkViewFactory()) doesn't seem to have
any effect. It doesn't produce an exception, it executes but it
doesn't work. I can as well remove this line, it will be the same as
before.

Any help would be greatly appreciated!

Christopher Pelatari

unread,
Jun 27, 2010, 7:49:05 PM6/27/10
to spar...@googlegroups.com
Instead of ViewEngines.Engines.Add, try this:

SparkEngineStarter.RegisterViewEngine(ViewEngines.Engines);
--
-Christopher Pelatari | http://bluefenix.net

> --
> You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.
> To post to this group, send email to spar...@googlegroups.com.
> To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/spark-dev?hl=en.
>
>

jba...@googlemail.com

unread,
Jun 28, 2010, 4:03:38 PM6/28/10
to Spark View Engine Dev
Hello Christopher,

thanks for your help. Unfortunately, that didn't solve the problem. I
will stop for now, maybe I will try Spark again in a few months when
it's more mature.

On 28 Jun., 01:49, Christopher Pelatari <christop...@bluefenix.net>
wrote:

Christopher Pelatari

unread,
Jun 28, 2010, 4:50:54 PM6/28/10
to spar...@googlegroups.com
If you want to write off spark because you think it's not mature
enough, that's your decision. However, be aware that there are plenty
of real world applications already using it quite successfully.

try registering your viewengine before your routes - that's how mine are setup.


--
-Christopher Pelatari | http://bluefenix.net

Curtis Mitchell

unread,
Jun 28, 2010, 4:55:46 PM6/28/10
to spar...@googlegroups.com
Use ViewEngines.Engines.Clear() to remove the default view engine before registering Spark.
Sent from my mobile

Louis DeJardin

unread,
Jun 28, 2010, 6:02:01 PM6/28/10
to spar...@googlegroups.com
Or try removing or renaming the aspx/ascx file - if you keep both you end up on relying on the order view engines appear in the collection. That could be more of a side effect of an implementation detail than an explicit part of how MVC is designed.
Reply all
Reply to author
Forward
0 new messages