From: Roobin
Date: 6/16/2011 9:59:29 AM
Hello Gareth,
I cant belive that noone from Telrik has helped you with this.
Trick is for you and anybody else facing this problem:
Inline Subs as in the example code below.
.Content(
Sub()
%>
<p style="text-align: center">
This is the content!
</p>
<%
EndSub
) _
For function as in various ClientEvents methods use this syntax
.ClientEvents(Function(ev) ev.OnChange("OnchangeJsMethod")) _
And for anonymous object its this syntax:
.HtmlAttributes(NewWith{ .style = "padding:5px;", .title = "a title"}) _
Here is the complete example
<% Html.Telerik().Window() _
.Name("Window") _
.Title("Telerik Window for ASP.NET MVC") _
.Draggable(True) _
.Resizable(
Sub(resizing)
Withresizing
.Enabled(True)
.MinHeight(250)
.MinWidth(250)
.MaxWidth(500)
.MaxWidth(500)
EndWith
EndSub
) _
.Scrollable(True) _
.Modal(True) _
.Buttons(
Sub(b)
b.Maximize()
b.Close()
EndSub
) _
.Content(
Sub()
%>
<p style="text-align: center">
<img src="<%= Url.Content("~/Content/Window/window.png")%>"
alt="Window for ASP.NET MVC logo"style="display:block;margin:0 auto
10px;" />
The Telerik Window for ASP.NET MVC is<br /> the right choice for creating Window
dialogs<br />
and alert/prompt/confirm boxes<br /> in your ASP.NET MVC applications.
</p>
<%
EndSub
) _
.Width(300) _
.Height(300) _
.Render()
%>
From: Gareth
Date: 6/2/2011 4:01:29 AM
O.K., if no-one can tell me how to convert
.Content(() =>
{%>
<p style="text-align: center">
<img src="<%= Url.Content("~/Content/Window/window.png")%>"
alt="Window for ASP.NET MVC logo"style="display:block;margin:0 auto
10px;" />
The Telerik Window forASP.NET MVC is<br /> the right choice forcreating Window
dialogs<br />
and alert/prompt/confirm boxes<br /> inyour ASP.NET MVC applications.
</p>
<%})
can anyone tell me what it's called? Is () => a lambda or anonymous or what? And what's it called when you have the html (i.e. the bit between %> <%) embedded in the function/lambda??
Thanks
Gareth
From: Gareth
Date: 5/31/2011 11:43:12 AM
Hi,
Can someone help with converting this to vb.net? I can't work out the .content section:
<%Html.Telerik().Window()
.Name("Window")
.Title("Telerik Window for ASP.NET MVC")
.Draggable((bool)ViewData["movable"])
.Resizable(resizing => resizing
.Enabled((bool)ViewData["resizable"])
.MinHeight(250)
.MinWidth(250)
.MaxHeight(500)
.MaxWidth(500)
)
.Scrollable((bool)ViewData["scrolling"])
.Modal((bool)ViewData["modal"])
.Buttons(b => b.Maximize().Close())
.Content(()=>
{%>
<pstyle="text-align: center">
<img src="<%=Url.Content("~/Content/Window/window.png")%>"
alt="Window for ASP.NET MVC logo" style="display:block;margin:0 auto
10px;" />
The Telerik Window for ASP.NET MVC is<br/> the right choice for creating Window
dialogs<br/>
and alert/prompt/confirm boxes<br/> in your ASP.NET MVC applications.
</p>
<%})
.Width(300)
.Height(300)
.Render();
%>
Thanks
Gareth