错误:HtmlSelect'不能具有'LiteralControl'类型的子代. [英] Error:HtmlSelect' cannot have children of type 'LiteralControl'.

查看:59
本文介绍了错误:HtmlSelect'不能具有'LiteralControl'类型的子代.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<select id="lstCountry1" size="3" name="cy1" multiple="true" style="width: 180px; height: 70px" runat="server" >
                        <option value="India">India</option>
                        <option value="USA">USA</option>


</select>


我在asp.net页面中使用html控件时遇到此错误.


</select>


I face this error while i''m using html controle in asp.net page

推荐答案

您的选择中没有LiteralControl,所以这不是给出的代码你的错误.但是,此错误表示它的含义,如果您选择服务器控件,则显然里面没有文字.您只需要以合理的方式设置项目,而不是通过文字即可.
There is no LiteralControl inside your select, so this is not the code that gives you the error. But, this error means what it says, if you make your select a server control, apparently you can''t have a literal inside it. You need to just set the items in a sane way, not through a literal.


这篇关于错误:HtmlSelect'不能具有'LiteralControl'类型的子代.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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