I'm working with Telerik's MVC Tabstrip control and am having an issue, although I suspect the issue is more my ignorance of how to properly use Lambda expressions and MVC helpers and not really Telerik-specific.
My helper call is this:
<% Html.Telerik().TabStrip()
.Name("BusinessDetailsTabs")
.Items(parent =>
{
parent.Add()
.Text("Facilities")
.Content(() =>
{%>
<%= Html.RenderPartial("~/Views/Shared/DisplayTemplates/BusinessRelations/FacilityGrid.ascx", new FacilitiesViewModel {Entities = Model.Facilities}) %>
<%});
})
.Render();
%>
The problem is that the Add().Content
method's signature is Content(string foo)
and apparently the way I'm calling the RenderPartial
, it's just not working - I get this exception: Compiler Error Message: CS1660: Cannot convert lambda expression to type 'string' because it is not a delegate type
How can I fix this so that I can still call this partial method? I have looked around and found a RenderPartialToString method but that sounds like a hack and it seems like this has a better solution than that.