1.RT:
比如说 我想把 以下内容做为xml response,然后客户端通过js DOM操作,改如何写服务器端的输出xml的代码??
name:aaa gender:boy
name:bbb gender:girl
2. 请问asp.net有没有封装好的方法,获得当前页面的绝对URL地址,(url+参数)
如 http://bbs.csdn.net/aaa.aspx?id=111
------解决方案--------------------------------------------------------
Request.URL就全都获得了。
------解决方案--------------------------------------------------------
XmlDocument doc = new XmlDocument();
XmlElement root = doc.CreateElement( "people ");
XmlNode person = doc.CreateElement( "person ") as XmlNode;
XmlAttribute name = doc.CreateAttribute( "name ");
name.Value = "aaa ";
person.Attributes.Append(name);
XmlAttribute gender = doc.CreateAttribute( "gender ");
gender.Value = "boy ";
person.Attributes.Append(gender);
root.AppendChild(person);
//....................
doc.AppendChild(root);
Response.Write(doc.OuterXml);
Response.End();