Bindings

9 views
Skip to first unread message

NickUk

unread,
Aug 24, 2010, 9:36:01 AM8/24/10
to Spark View Engine Dev
First off: I love them!

Secondly: I cannot get them to work correctly in some cases.

I have tried to create a partial binding that renders a partial view
by passing a name and a model:

Binding:
<element name="partial">#Html.RenderPartial("@name", @data)</element>

Code that I want it to replace in my view:
#Html.RenderPartial("FeedbackPageTable", Model);

My usage of the partial attribute:
<partial name="'FeedbackPageTable'" data=Model />

The page doesn't throw any errors - but it also doesn't render the
partial. I have to assume the model is not being passed throguh. The
code I want to replace (shown above) definitely works.

Please can someone tell me what I'm missing?

Cheers guys

Robert Greyling

unread,
Aug 24, 2010, 12:19:37 PM8/24/10
to spar...@googlegroups.com
Typing this from my iPhone since I'm on vacation without internet so here goes:

Html.RenderPartial (to my knowledge) is the MSMVC helper used when rendering ascx partials. In your case, if your partial is a spark partial, then you don't need Bindings, you can just call it by typing <FeedbackPageTable/>

Hope that works.

Cheers,
Rob

> --
> 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.
>

NickUk

unread,
Aug 24, 2010, 1:11:46 PM8/24/10
to Spark View Engine Dev
Thanks for the reply. I have not noticed this on the spark docs.

Is there a property for passing a model to the partial?

On Aug 24, 5:19 pm, Robert Greyling <robertgreyl...@gmail.com> wrote:
> Typing this from my iPhone since I'm on vacation without internet so here goes:
>
> Html.RenderPartial (to my knowledge) is the MSMVC helper used when rendering ascx partials. In your case, if your partial is a spark partial, then you don't need Bindings, you can just call it by typing <FeedbackPageTable/>
>
> Hope that works.
>
> Cheers,
> Rob
>

Christopher Pelatari

unread,
Aug 24, 2010, 1:25:45 PM8/24/10
to spar...@googlegroups.com
use the viewdata element in your partial:
http://sparkviewengine.com/documentation/organizingcontent#Importingfiles
--
-Christopher Pelatari | http://bluefenix.net

Louis DeJardin

unread,
Aug 24, 2010, 9:53:42 PM8/24/10
to spar...@googlegroups.com

The binding might be okay,

<element name="partial">#Html.RenderPartial("@name", @data)</element>

But I think your usage might need some adjustments around the quoting of attributes...


<partial name="'FeedbackPageTable'" data=Model />

Try:
<partial name="FeedbackPageTable" data="Model" />

NickUk

unread,
Aug 25, 2010, 4:39:04 AM8/25/10
to Spark View Engine Dev
Hi Guys,

Thanks for the replies and sorry to sound like a bit of a hassle.

I really like the idea of bindings hence perservering with them.
Having tried Louis' lates suggestion I get the error:

error CS1040: Preprocessor directives must appear as the first non-
whitespace character on a line

Something must be awry with my setup. The examples in the spark docs
also do not work. The From, the a all do not work on my machine.

Some do, some don't.

Hopefully I'll get a bit of free time to investigate further - and
hopefully it is a mistake of my own rather than a setup issue.

On Aug 25, 2:53 am, Louis DeJardin <lodej...@microsoft.com> wrote:
> The binding might be okay,
> <element name="partial">#Html.RenderPartial("@name", @data)</element>
>
> But I think your usage might need some adjustments around the quoting of attributes...
> <partial name="'FeedbackPageTable'" data=Model />
>
> Try:
> <partial name="FeedbackPageTable" data="Model" />
>
> -----Original Message-----
> From: spar...@googlegroups.com [mailto:spar...@googlegroups.com] On Behalf Of Christopher Pelatari
> Sent: Tuesday, August 24, 2010 10:26 AM
> To: spar...@googlegroups.com
> Subject: Re: Bindings
>
> use the viewdata element in your partial:http://sparkviewengine.com/documentation/organizingcontent#Importingf...
> --
> -Christopher Pelatari |http://bluefenix.net
>

NickUk

unread,
Aug 25, 2010, 9:39:27 AM8/25/10
to Spark View Engine Dev
Just to clarify. It seems to be all binding that actually pass data -
as part of a dictionary, as part of viewdata or even the viewdata
model itself.

Is it possilbe I may need to change a setting somewhere?

Cheers

jkemp

unread,
Sep 28, 2010, 4:18:03 PM9/28/10
to Spark View Engine Dev
Hello,

I'm getting the same error. It looks like it's not treating the #
symbol correctly. It's doing an Output.Write(# instead of just writing
out everything after the hash. Here's what I'm getting in my debug:

153 try
154 {
155
156 Output.Write(# Html.RenderPartial("pm.Partial + 'Edit'", new
ViewDataDictionary{{PaymentMethod=pm,FullModel=m,CheckoutHelper=helper}}););
157
158 }
159 catch(System.NullReferenceException)
160 {
161 Output.Write("${# Html.RenderPartial(\"pm.Partial + 'Edit'\", new
ViewDataDictionary{{PaymentMethod=pm,FullModel=m,CheckoutHelper=helper}});}");
162 }

I'm still digging through the code trying to find out where it parses
this. Any thoughts?
John

Rob G

unread,
Sep 28, 2010, 5:37:31 PM9/28/10
to spar...@googlegroups.com
Hey John,

To me it just looks like some missing quotes either in your binding or your binding usage. Would you be able to post those two snippits and we can have a look to see if there are any missing quotes?

Thanks,
Rob

Rob G

unread,
Sep 28, 2010, 5:45:55 PM9/28/10
to spar...@googlegroups.com
Hey John,

Have you tried surrounding pm.Partial + 'Edit' with ${ ... } perhaps?

Regards,
Rob

On Tue, Sep 28, 2010 at 10:40 PM, jkemp <super...@gmail.com> wrote:
Rob,

Yes, below are both the binding and the call

<element name="Partial"># Html.RenderPartial("@name", new
ViewDataDictionary{{"@*"}});</element>


<Partial name="pm.Partial + 'Edit'" PaymentMethod="${pm}" FullModel="$
{m}" CheckoutHelper="${helper}" />


Thanks!


On Sep 28, 4:37 pm, Rob G <robertgreyl...@gmail.com> wrote:
> Hey John,
>
> To me it just looks like some missing quotes either in your binding or your
> binding usage. Would you be able to post those two snippits and we can have
> a look to see if there are any missing quotes?
>
> Thanks,
> Rob
>

> > .
> > > > > >> > For more options, visit this group athttp://
> > groups.google.com/group/spark-dev?hl=en.
>
> > > > > > --
> > > > > > 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

> > .
> > > > > > For more options, visit this group athttp://
> > groups.google.com/group/spark-dev?hl=en.
>
> > > > > --
> > > > > 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

> > .
> > > > > For more options, visit this group athttp://
> > groups.google.com/group/spark-dev?hl=en.
>
> > --
> > 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

Rob G

unread,
Sep 28, 2010, 5:55:32 PM9/28/10
to spar...@googlegroups.com
I don't have the code locally, so I'm basically using you as the debugger :)

Try and take the quotes away from around your @name in the binding definition...

On Tue, Sep 28, 2010 at 10:51 PM, jkemp <super...@gmail.com> wrote:
Rob,

Thanks for the quick response. I tried as you suggested:

<Partial name="${pm.Partial + 'Edit'}" PaymentMethod="${pm}"

FullModel="${m}" CheckoutHelper="${helper}" />

and I got back a similar exception (notice missing quotes around
pm.Parital + "Edit"):

Output.Write(# Html.RenderPartial(pm.Partial + "Edit", new
ViewDataDictionary{{PaymentMethod=pm,FullModel=m,CheckoutHelper=helper}}););

Thanks.


On Sep 28, 4:45 pm, Rob G <robertgreyl...@gmail.com> wrote:
> Hey John,
>
> Have you tried surrounding pm.Partial + 'Edit' with ${ ... } perhaps?
>
> Regards,
> Rob
>

>
> > > > .
> > > > > > > >> > For more options, visit this group athttp://
> > > > groups.google.com/group/spark-dev?hl=en.
>
> > > > > > > > --
> > > > > > > > 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<spark-dev%2Bunsu...@googlegroups.com>

>
> > > > .
> > > > > > > > For more options, visit this group athttp://
> > > > groups.google.com/group/spark-dev?hl=en.
>
> > > > > > > --
> > > > > > > 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<spark-dev%2Bunsu...@googlegroups.com>

>
> > > > .
> > > > > > > For more options, visit this group athttp://
> > > > groups.google.com/group/spark-dev?hl=en.
>
> > > > --
> > > > 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<spark-dev%2Bunsu...@googlegroups.com>

jkemp

unread,
Sep 28, 2010, 5:51:05 PM9/28/10
to Spark View Engine Dev
Rob,

Thanks for the quick response. I tried as you suggested:

<Partial name="${pm.Partial + 'Edit'}" PaymentMethod="${pm}"
FullModel="${m}" CheckoutHelper="${helper}" />

and I got back a similar exception (notice missing quotes around
pm.Parital + "Edit"):

Output.Write(# Html.RenderPartial(pm.Partial + "Edit", new
ViewDataDictionary{{PaymentMethod=pm,FullModel=m,CheckoutHelper=helper}}););

Thanks.

On Sep 28, 4:45 pm, Rob G <robertgreyl...@gmail.com> wrote:
> Hey John,
>
> Have you tried surrounding pm.Partial + 'Edit' with ${ ... } perhaps?
>
> Regards,
> Rob
>
> > <spark-dev%2Bunsu...@googlegroups.com<spark-dev%252Buns...@googlegroups.com>
>
> > > > .
> > > > > > > >> > For more options, visit this group athttp://
> > > > groups.google.com/group/spark-dev?hl=en.
>
> > > > > > > > --
> > > > > > > > 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<spark-dev%2Bunsu...@googlegroups.com>
> > <spark-dev%2Bunsu...@googlegroups.com<spark-dev%252Buns...@googlegroups.com>
>
> > > > .
> > > > > > > > For more options, visit this group athttp://
> > > > groups.google.com/group/spark-dev?hl=en.
>
> > > > > > > --
> > > > > > > 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<spark-dev%2Bunsu...@googlegroups.com>
> > <spark-dev%2Bunsu...@googlegroups.com<spark-dev%252Buns...@googlegroups.com>
>
> > > > .
> > > > > > > For more options, visit this group athttp://
> > > > groups.google.com/group/spark-dev?hl=en.
>
> > > > --
> > > > 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<spark-dev%2Bunsu...@googlegroups.com>
> > <spark-dev%2Bunsu...@googlegroups.com<spark-dev%252Buns...@googlegroups.com>

jkemp

unread,
Sep 28, 2010, 5:40:17 PM9/28/10
to Spark View Engine Dev
Rob,

Yes, below are both the binding and the call

<element name="Partial"># Html.RenderPartial("@name", new
ViewDataDictionary{{"@*"}});</element>


<Partial name="pm.Partial + 'Edit'" PaymentMethod="${pm}" FullModel="$
{m}" CheckoutHelper="${helper}" />


Thanks!

On Sep 28, 4:37 pm, Rob G <robertgreyl...@gmail.com> wrote:
> Hey John,
>
> To me it just looks like some missing quotes either in your binding or your
> binding usage. Would you be able to post those two snippits and we can have
> a look to see if there are any missing quotes?
>
> Thanks,
> Rob
>
> > spark-dev+...@googlegroups.com<spark-dev%2Bunsu...@googlegroups.com>
> > .
> > > > > >> > For more options, visit this group athttp://
> > groups.google.com/group/spark-dev?hl=en.
>
> > > > > > --
> > > > > > 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<spark-dev%2Bunsu...@googlegroups.com>
> > .
> > > > > > For more options, visit this group athttp://
> > groups.google.com/group/spark-dev?hl=en.
>
> > > > > --
> > > > > 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<spark-dev%2Bunsu...@googlegroups.com>
> > .
> > > > > For more options, visit this group athttp://
> > groups.google.com/group/spark-dev?hl=en.
>
> > --
> > 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<spark-dev%2Bunsu...@googlegroups.com>
> > .

jkemp

unread,
Sep 28, 2010, 6:15:58 PM9/28/10
to Spark View Engine Dev
Rob,

I also ran this test in the Spark.Tests project in the
BindingExecutionTester.cs class.

Unless I'm misunderstanding how Spark works, it doesn't look like it's
picking up the # as a statement token.

[Test]
public void ElementReplacedWithCSharpCodeLiteral() {
_viewFolder.Add("bindings.xml", @"<bindings><element
name='hello'># var b = 5; Response.Write(b);</element></bindings>");
_viewFolder.Add("home\\index.spark", @"<p><hello/></p>");

var contents = Render("index");
Assert.That(contents, Is.EqualTo(@"<p>5</p>"));
}


Output

17 #line hidden
18 Output.Write("<p>");
19 #line default
20 try
21 {
22 #line default
23 Output.Write(# var b = 5; Response.Write(b););
24 #line default
25 }
26 catch(System.NullReferenceException)
27 {
28 Output.Write("${# var b = 5; Response.Write(b);}");
29 }
30 #line hidden
31 Output.Write("</p>");
32 #line default

Thanks.

Rob G

unread,
Sep 28, 2010, 6:21:02 PM9/28/10
to spar...@googlegroups.com
Hey John,

Aha! I think I may just have spotted something (and I think it's a bug). Will have to check the source to know for sure.

The reason for using the # in the binding definition is to let Spark Bindings know that the method returns void - *not* that it's a statement token - and not to expect a return value.

Try taking the space after the # out and put it right up against the Html.RenderPartial and put the other things back the way they were...

Let me know how that turns out.

On Tue, Sep 28, 2010 at 11:06 PM, jkemp <super...@gmail.com> wrote:
I appreciate your time and help.

I tried it with a few variations but they're all doing the same thing.

The thing that concerns me is that Html.RenderPartial is a void
function but it's still treating it with an Output.Write. Are you
thinking the formatting is throwing off what type it's parsing to?

I'm trying to make and run some tests in the source but I can't get
nUnit to work. Stinking 64bit windows 7 :)

Thanks for your help.
John

On Sep 28, 4:40 pm, jkemp <superjod...@gmail.com> wrote:
To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.

Rob G

unread,
Sep 28, 2010, 6:26:22 PM9/28/10
to spar...@googlegroups.com
Yes I noticed this too....but this is for code you want to render out verbatim into the generated C# class, and so no evaluation takes place on it - for example, you're asking for just the string concatenation of pm.Partial + 'Edit' to be evaluated and put in as a string into the RenderPartial method call.

P.S. NUnit works just fine on my Win 7 x64...

To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.

jkemp

unread,
Sep 28, 2010, 6:06:15 PM9/28/10
to Spark View Engine Dev
I appreciate your time and help.

I tried it with a few variations but they're all doing the same thing.

The thing that concerns me is that Html.RenderPartial is a void
function but it's still treating it with an Output.Write. Are you
thinking the formatting is throwing off what type it's parsing to?

I'm trying to make and run some tests in the source but I can't get
nUnit to work. Stinking 64bit windows 7 :)

Thanks for your help.
John

On Sep 28, 4:40 pm, jkemp <superjod...@gmail.com> wrote:

Louis DeJardin

unread,
Sep 28, 2010, 8:34:17 PM9/28/10
to spar...@googlegroups.com

With quotes around “@name” the tersest form would be <Partial name=”${pm.Partial}Name” /> - it’ll rewrite the expression into pm.Partial + “Name”.

 

Well, to be exact it’ll be string.Concat(pm.Partial, “Name”) to avoid potential problems with any operators inside the ${} having lower precedence than +”Name”

 

Also - you might want to have ViewDataDictionary{{@*}}instead of ViewDataDictionary{{"@*"}}

 

You’ll want to see if that works first, of course, but from the example it looks like the goal is a dictionary of objects rather than a dictionary of strings - so the stringified variation is forcing you to add a lot of things like FullModel=”${m}” instead of FullModel=”m”.

jkemp

unread,
Sep 28, 2010, 9:12:10 PM9/28/10
to Spark View Engine Dev
Thanks for the suggestion. It did make the call more terse. However,
it's still not fixing the issue.

Again, the output is now:

Output.Write(#Html.RenderPartial(string.Concat(pm.Partial,"Edit"), new
ViewDataDictionary{{PaymentMethod=pm,FullModel=m,CheckoutHelper=helper}}););

However, I get the feeling it should just be

Html.RenderPartial(string.Concat(pm.Partial,"Edit"), new
ViewDataDictionary{{PaymentMethod=pm,FullModel=m,CheckoutHelper=helper}});

(actually, i think the ViewDataDictionary should be
ViewDataDictionary{{"PaymentMethod"=pm,"FullModel"=m,"CheckoutHelper"=helper}} )

I guess I assumed it would behave as other # statements. Am I missing
something?

Thanks again.

On Sep 28, 7:34 pm, Louis DeJardin <lodej...@microsoft.com> wrote:
> With quotes around "@name" the tersest form would be <Partial name="${pm.Partial}Name" /> - it'll rewrite the expression into pm.Partial + "Name".
>
> Well, to be exact it'll be string.Concat(pm.Partial, "Name") to avoid potential problems with any operators inside the ${} having lower precedence than +"Name"
>
> Also - you might want to have ViewDataDictionary{{@*}}instead of ViewDataDictionary{{"@*"}}
>
> You'll want to see if that works first, of course, but from the example it looks like the goal is a dictionary of objects rather than a dictionary of strings - so the stringified variation is forcing you to add a lot of things like FullModel="${m}" instead of FullModel="m".
>
> From: spar...@googlegroups.com [mailto:spar...@googlegroups.com] On Behalf Of Rob G
> Sent: Tuesday, September 28, 2010 3:26 PM
> To: spar...@googlegroups.com
> Subject: Re: Bindings
>
> Yes I noticed this too....but this is for code you want to render out verbatim into the generated C# class, and so no evaluation takes place on it - for example, you're asking for just the string concatenation of pm.Partial + 'Edit' to be evaluated and put in as a string into the RenderPartial method call.
>
> On Sep 28, 4:40 pm, jkemp <superjod...@gmail.com<mailto:superjod...@gmail.com>> wrote:
>
> > Rob,
>
> > Yes, below are both the binding and the call
>
> > <element name="Partial"># Html.RenderPartial("@name", new
> > ViewDataDictionary{{"@*"}});</element>
>
> > <Partial name="pm.Partial + 'Edit'" PaymentMethod="${pm}" FullModel="$
> > {m}" CheckoutHelper="${helper}" />
>
> > Thanks!
>
> > On Sep 28, 4:37 pm, Rob G <robertgreyl...@gmail.com<mailto:robertgreyl...@gmail.com>> wrote:
>
> > > Hey John,
>
> > > To me it just looks like some missing quotes either in your binding or your
> > > binding usage. Would you be able to post those two snippits and we can have
> > > a look to see if there are any missing quotes?
>
> > > Thanks,
> > > Rob
>
> > > On Tue, Sep 28, 2010 at 9:18 PM, jkemp <superjod...@gmail.com<mailto:superjod...@gmail.com>> wrote:
> > > > Hello,
>
> > > > I'm getting the same error. It looks like it's not treating the #
> > > > symbol correctly. It's doing an Output.Write(# instead of just writing
> > > > out everything after the hash. Here's what I'm getting in my debug:
>
> > > > 153     try
> > > > 154 {
> > > > 155
> > > > 156     Output.Write(# Html.RenderPartial("pm.Partial + 'Edit'", new
>
> > > > ViewDataDictionary{{PaymentMethod=pm,FullModel=m,CheckoutHelper=helper}}););
> > > > 157
> > > > 158 }
> > > > 159     catch(System.NullReferenceException)
> > > > 160 {
> > > > 161 Output.Write("${# Html.RenderPartial(\"pm.Partial + 'Edit'\", new
>
> > > > ViewDataDictionary{{PaymentMethod=pm,FullModel=m,CheckoutHelper=helper}});}");
> > > > 162 }
>
> > > > I'm still digging through the code trying to find out where it parses
> > > > this. Any thoughts?
> > > > John
>
> > > > On Aug 25, 8:39 am, NickUk <tune...@hotmail.com<mailto:tune...@hotmail.com>> wrote:
> > > > > Just to clarify. It seems to be all binding that actually pass data -
> > > > > as part of a dictionary, as part of viewdata or even the viewdata
> > > > > model itself.
>
> > > > > Is it possilbe I may need to change a setting somewhere?
>
> > > > > Cheers
>
> > > > > On Aug 25, 9:39 am, NickUk <tune...@hotmail.com<mailto:tune...@hotmail.com>> wrote:
>
> > > > > > Hi Guys,
>
> > > > > > Thanks for the replies and sorry to sound like a bit of a hassle.
>
> > > > > > I really like the idea of bindings hence perservering with them.
> > > > > > Having tried Louis' lates suggestion I get the error:
>
> > > > > > error CS1040: Preprocessor directives must appear as the first non-
> > > > > > whitespace character on a line
>
> > > > > > Something must be awry with my setup. The examples in the spark docs
> > > > > > also do not work. The From, the a all do not work on my machine.
>
> > > > > > Some do, some don't.
>
> > > > > > Hopefully I'll get a bit of free time to investigate further - and
> > > > > > hopefully it is a mistake of my own rather than a setup issue.
>
> > > > > > On Aug 25, 2:53 am, Louis DeJardin <lodej...@microsoft.com<mailto:lodej...@microsoft.com>> wrote:
>
> > > > > > > The binding might be okay,
> > > > > > > <element name="partial">#Html.RenderPartial("@name", @data)</element>
>
> > > > > > > But I think your usage might need some adjustments around the quoting
> > > > of attributes...
> > > > > > > <partial name="'FeedbackPageTable'" data=Model />
>
> > > > > > > Try:
> > > > > > > <partial name="FeedbackPageTable" data="Model" />
>
> > > > > > > -----Original Message-----
> > > > > > > From: spar...@googlegroups.com<mailto:spar...@googlegroups.com> [mailto:spar...@googlegroups.com<mailto:spar...@googlegroups.com>]
> > > > On Behalf Of Christopher Pelatari
> > > > > > > Sent: Tuesday, August 24, 2010 10:26 AM
> > > > > > > To: spar...@googlegroups.com<mailto:spar...@googlegroups.com>
> > > > > > > Subject: Re: Bindings
>
> > > > > > > use the viewdata element in your partial:
> > > >http://sparkviewengine.com/documentation/organizingcontent#Importingf...
> > > > > > > --
> > > > > > > -Christopher Pelatari |http://bluefenix.net
>
> > > > > > > On Tue, Aug 24, 2010 at 12:11 PM, NickUk <tune...@hotmail.com<mailto:tune...@hotmail.com>>
> > > > wrote:
> > > > > > > > Thanks for the reply. I have not noticed this on the spark docs.
>
> > > > > > > > Is there a property for passing a model to the partial?
>
> > > > > > > > On Aug 24, 5:19 pm, Robert Greyling <robertgreyl...@gmail.com<mailto:robertgreyl...@gmail.com>>
> > > > wrote:
> > > > > > > >> Typing this from my iPhone since I'm on vacation without internet
> > > > so here goes:
>
> > > > > > > >> Html.RenderPartial (to my knowledge) is the MSMVC helper used when
> > > > rendering ascx partials. In your case, if your partial is a spark partial,
> > > > then you don't need Bindings, you can just call it by typing
> > > > <FeedbackPageTable/>
>
> > > > > > > >> Hope that works.
>
> > > > > > > >> Cheers,
> > > > > > > >> Rob
>
> > > > > > > >> On 24 Aug 2010, at 14:36, NickUk <tune...@hotmail.com<mailto:tune...@hotmail.com>> wrote:
>
> > > > > > > >> > First off: I love them!
>
> > > > > > > >> > Secondly: I cannot get them to work correctly in some cases.
>
> > > > > > > >> > I have tried to create a partial binding that renders a partial
> > > > view
> > > > > > > >> > by passing a name and a model:
>
> > > > > > > >> > Binding:
> > > > > > > >> > <element name="partial">#Html.RenderPartial("@name",
> > > > @data)</element>
>
> > > > > > > >> > Code that I want it to replace in my view:
> > > > > > > >> > #Html.RenderPartial("FeedbackPageTable", Model);
>
> > > > > > > >> > My usage of the partial attribute:
> > > > > > > >> > <partial name="'FeedbackPageTable'" data=Model />
>
> > > > > > > >> > The page doesn't throw any errors - but it also doesn't render
> > > > the
> > > > > > > >> > partial. I have to assume the model is not being passed throguh.
> > > > The
> > > > > > > >> > code I want to replace (shown above) definitely works.
>
> > > > > > > >> > Please can someone tell me what I'm missing?
>
> > > > > > > >> > Cheers guys
>
> > > > > > > >> > --
> > > > > > > >> > 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<mailto:spar...@googlegroups.com>
> > > > .
> > > > > > > >> > To unsubscribe from this group, send email to
> > > > spark-dev+...@googlegroups.com<mailto:spark-dev%2Bunsu...@googlegroups.com><spark-dev%2Bunsu...@googlegroups.com<mailto:spark-dev%252Buns...@googlegroups.com>>
> > > > .
> > > > > > > >> > For more options, visit this group athttp://
> > > > groups.google.com/group/spark-dev?hl=en<http://groups.google.com/group/spark-dev?hl=en>.
>
> > > > > > > > --
> > > > > > > > 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<mailto:spar...@googlegroups.com>.
> > > > > > > > To unsubscribe from this group, send email to
> > > > spark-dev+...@googlegroups.com<mailto:spark-dev%2Bunsu...@googlegroups.com><spark-dev%2Bunsu...@googlegroups.com<mailto:spark-dev%252Buns...@googlegroups.com>>
> > > > .
> > > > > > > > For more options, visit this group athttp://
> > > > groups.google.com/group/spark-dev?hl=en<http://groups.google.com/group/spark-dev?hl=en>.
>
> > > > > > > --
> > > > > > > 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<mailto:spar...@googlegroups.com>.
> > > > > > > To unsubscribe from this group, send email to
> > > > spark-dev+...@googlegroups.com<mailto:spark-dev%2Bunsu...@googlegroups.com><spark-dev%2Bunsu...@googlegroups.com<mailto:spark-dev%252Buns...@googlegroups.com>>
> > > > .
>
> ...
>
> read more »

jkemp

unread,
Sep 29, 2010, 2:41:09 PM9/29/10
to Spark View Engine Dev
Thanks again guys for your help. I've come to figure out that I was
using the 1.1 stable build and not the latest dev builds. I now have
it working with build 1.1.39981.0.

Thanks!
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages