错误-名称不能以''字符(十六进制值0x20)开头.第1行,位置3. [英] Error -Name cannot begin with the ' ' character, hexadecimal value 0x20. Line 1, position 3.
本文介绍了错误-名称不能以''字符(十六进制值0x20)开头.第1行,位置3.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的衣着写在下面
My coading is given below
<% @ Import NameSpace="System.Data"%>
<% @ Page Language="VB" Debug="true"%>
<Script runat="server">
Sub Page_Load
if not Page.IsPostBack then
dim mycountries = New Dataset
mycountries.Readxml(MapPath("countries.xml"))
rb.DataSource = mycountries
rb.DataValueField = "value"
rb.DataTextField = "Text"
rb.DataBind()
End if
End Sub
Sub displayMassage (s As object, e As EventArgs)
Lbl1.Text = "Your Favourite Country is:" & rb.SelectedItem.Text
End Sub
</script>
<html>
<head>
<title>Hashtable with XML File</title>
</head>
<body>
<form runat="server">
<asp:CheckBoxList id = "rb" runat = "server" AutoPostBack = "True" onSelectedIndexChanged = "displayMassage"/>
<p>
<asp:Label id = "Lbl1" runat = "server"/>
</p>
</form>
</body>
</html>
我的XML文件的包含内容如下所示:
And My XML file''s containts is given below
<? xml version = "1.0" encoding = "ISO-8859-1"?>
<countries>
<country>
<text>Norway</text>
<value>N</value>
</country>
<country>
<text>Sweden</text>
<value>S</value>
</country>
<country>
<text>France</text>
<value>F</value>
</country>
<country>
<text>Italy</text>
<value>I</value>
</country>
</countries>
推荐答案
它在第一行的第三个字符处包含空格.
请删除
It contains space at the 3rd char in the 1st line.
Please remove it
<?xml version = "1.0" encoding = "ISO-8859-1"?>
使用上面的行
use the above line
这篇关于错误-名称不能以''字符(十六进制值0x20)开头.第1行,位置3.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文