출처 : http://elvagood.egloos.com/tb/2385404


var aaa = new Array();
// aaa[0][0] = "1111";
// aaa[0][1] = "2222";
// aaa[1][0] = "asdf";
// aaa[2][1] = "fdsa";

Member = function(id, name) {
this.id = new Array();
this.name = new Array();


// this.id = id;
// this.name = name;
Member.prototype.add = function(id, name)
{
this.id.push(id);
this.name.push(name);
}

Member.prototype.toString = function()
{
var ret = "";
ret = "<?xml version='1.0' encoding='UTF-8'?>"
ret += "<members>"
for (var i=0; i < this.id.length ; i++)
{
ret += "<member>"+"<name>" + this.name[i] + '</name>' + "<id><![CDATA[" + this.id[i] + ']]></id>' + "</member>";
}
ret += "</members>"
return ret;
}
}
var mem = new Member();

mem.add("한글&","1");
mem.add("2","2");

alert(mem.toString());

GetObject("HiddenField1").value = mem;
===================================================
===================================================
UTF8Encoding asc = new UTF8Encoding(); //한글지원
byte[] by = asc.GetBytes(HiddenField1.Value);
System.IO.MemoryStream ms = new System.IO.MemoryStream(by);
System.Xml.XmlTextReader xmltx = new System.Xml.XmlTextReader(ms);
xmltx.MoveToContent();
//System.IO.MemoryStream streamXML =
// new System.IO.MemoryStream(System.Text.UTF8Encoding. .GetBytes(HiddenField1.Value));
DataSet ds = new DataSet();

+ Recent posts