Click here to Skip to main content
15,905,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

In my windowapplication I integrate gmap. Now I want to call javascript function. Here I want to pass XmlDocument.

But when I want to see what I passed. alert("hi"+result) it shows only Hi not xml data


C#
System.Xml.XmlDocument d = DataConnection.GetRecentInfos("1021");
             try
             {
                 object[] arg ={d};
                 webBrowser1.Document.InvokeScript("OnComplete",arg);
             }

Please tell me how can I solve it

Thanks
Posted
Updated 3-Mar-11 23:44pm
v2

When Displaying XML Data inside alert you should encode it using

HttpUtility.HtmlEncode(result);


otherwise the browser will try to read it as HTML.
 
Share this answer
 
try

C#
System.Xml.XmlDocument d = DataConnection.GetRecentInfos("1021");
             try
             {
                 object[] arg ={d.OuterXml};
                 webBrowser1.Document.InvokeScript("OnComplete",arg);
             }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900