通过Pro ASP.NET MVC书籍的工作,我得到以下代码片段出现在aspx(view)页面中...如何呈现以下asp.net mvc c#代码片段作为vb.net代码
<%= Html.DropDownList ("WillAttend",new[]
{
new SelectListItem { Text = "Yes, I'll be there",Value=bool.TrueString},
new SelectListItem { Text = "No, I can't come",Value=bool.FalseString}
},"Choose an option"); %>
有人可以帮助我将其转换为vb.net等效。
任何想法的人?
编辑
更多详情
这里是整个代码段。不知道它会有帮助,但它在这里。
<body>
<h1>RSVP</h1>
<% using(Html.BeginForm()) { %>
<p> Your name: <%= Html.TextBox("Name") %></p>
<p> Your email: <%= Html.TextBox("Email") %></p>
<p> Your phone: <%= Html.TextBox("Phone") %></p>
<p>
Will you attend?
<%= Html.DropDownList ("WillAttend",new[]
{
new SelectListItem { Text = "Yes, I'll be there",Value=bool.TrueString},
new SelectListItem { Text = "No, I can't come",Value=bool.FalseString}
},"Choose an option") %>
</p>
<input type="submit" value="Submit RSVP" />
<% } %>
</body>
任何帮助表示赞赏。我真的无法弄清楚这一点。
赛斯
谢谢你的回答......让你在一分钟知道是否奏效。 对于记录...在发布我的问题之前,我尝试将代码转换为http://www.developerfusion.com/tools/convert/vb-to-csharp/ Seth – 2009-08-04 03:48:53
为了记录...那没用。 [“WillAttend”,New()]在New之后有一个错误波形线(反正叫什么?),表示Type Expected。 New NewList中的[New SelectListItem]在语法错误的新单词下有一个波形。所有的数组加载器({})都有错误,表明语法错误。与选择一个选项字符串相同。 – 2009-08-04 03:54:26
尝试建设。也尝试发布周围的HTML代码。我发现写入时调试器有点吸引人的查看页面,尤其是如果它在一个标签内(不知道为什么会这样,但是...) – 2009-08-04 06:07:51