帮助从C#转换代码 [英] Help converting code from C#

查看:82
本文介绍了帮助从C#转换代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Telerik MVC控件,但所有代码示例都在C#中。我通常可以自己转换,但不能让这个工作。谁能告诉我VB.NET中应该有什么?我无法解决.content部分

I'm trying to use the Telerik MVC controls but all of the code samples are in C#. I can usually convert them myself but can't get this one to work. Can anyone tell me what the following should be in VB.NET? I can't work out the .content section

提前致谢

Gareth





  <% 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(() =>
      {%>
        <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>
      <%})
      .Width(300)
      .Height(300)
      .Render();
  %>

推荐答案

对于格式化很抱歉 - 维护这种格式非常困难:

Sorry about the formatting - it's very hard to maintain this type of formatting:

 


 <%
 Html.Telerik().Window().Name("Window").Title("Telerik Window for ASP.NET MVC").Draggable(CBool(ViewData("movable"))).Resizable(Function(resizing) resizing.Enabled(CBool(ViewData("resizable"))).MinHeight(250).MinWidth(250).MaxHeight(500).MaxWidth(500)).Scrollable(CBool(ViewData("scrolling"))).Modal(CBool(ViewData("modal"))).Buttons(Function(b) b.Maximize().Close()).Content(Sub() "Window for ASP.NET MVC logo" style="display:block;margin:0 auto 10px;" /> The Telerik Window for ASP.NET TypeOf TypeOf TypeOf MVC Is<br /> the right choice for creating Window dialogs<br /> and alert/prompt/confirm boxes<br /> in your ASP.NET MVC applications.</p> <%
"<%= Url.Content("~/Content/Window/window.png")%>" alt="Window for ASP.NET MVC logo" style
"text-align: center"> <img src="<%= Url.Content("~/Content/Window/window.png")%>" alt
%> <p style="text-align: center"> <img src).Width(300).Height(300).Render()
 %>


这篇关于帮助从C#转换代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆