TreeView Error

dame_78

New Member
Dry and James thanks for your little discussion earlier on Treeview I have my page writting my xml and my folder structure is perfect however when i goto use the NavigateURL=<BR>if my navigation url has an &(ampersand) in it, it will give me the error at the bottom of this post.<BR>Code:<BR>gourl="ManageUsers.aspx?username=Broker&userId=1";<BR>that above will now work whereas<BR>gourl="ManageUsers.aspx?username=Broker";<BR>Will, the error is in the ampersand some way or how, i have tested it many times with different values ect. <BR><BR>Any Ideas?<BR><BR><BR><BR><BR>************************<BR>This is an unexpected token. Expected 'SEMICOLON'. Line 2, position 85. <BR>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <BR><BR>Exception Details: System.Xml.XmlException: This is an unexpected token. Expected 'SEMICOLON'. Line 2, position 85.<BR><BR>Source Error: <BR><BR><BR>Line 44: Treeview1.TreeNodeSrc=http://aspmessageboard.com/archive/index.php/"admin/TreeXML.aspx?user="+Context.User.Identity.Name;<BR>Line 45: <BR>Line 46: Treeview1.DataBind();<BR>Line 47: <BR>Line 48: <BR> <BR><BR>Source File: d:projectsispyportalportalcsvsadminusers.ascx.cs Line: 46 <BR><BR>Stack Trace: <BR><BR><BR>[XmlException: This is an unexpected token. Expected 'SEMICOLON'. Line 2, position 85.]<BR> System.Xml.XmlScanner.ScanNamedEntity() +840<BR> System.Xml.XmlTextReader.ExpandLiteral(XmlAttribut eTokenInfo currToken) +287<BR> System.Xml.XmlTextReader.SetLiteralValues(XmlAttri buteTokenInfo fld) +189<BR> System.Xml.XmlTextReader.SetAttributeValues() +206<BR> System.Xml.XmlTextReader.ParseElement() +140<BR> System.Xml.XmlTextReader.Read() +94<BR> System.Xml.XmlTextReader.SkipElementScope() +35<BR> System.Xml.XmlTextReader.ReadInnerXml() +277<BR> Microsoft.Web.UI.WebControls.TreeView.ReadXmlSrc(S tring TreeNodeSrc, String TreeNodeXsltSrc, String strOuter) +201<BR> Microsoft.Web.UI.WebControls.TreeView.ReadTreeNode XmlSrc() +80<BR> Microsoft.Web.UI.WebControls.TreeView.DataBind() +124<BR> ASPNetPortal.Users.Page_Load(Object sender, EventArgs e) in d:projectsispyportalportalcsvsadminusers.ascx.cs:4 6<BR> System.Web.UI.Control.OnLoad(EventArgs e) +67<BR> System.Web.UI.Control.LoadRecursive() +29<BR> System.Web.UI.Control.LoadRecursive() +92<BR> System.Web.UI.Control.LoadRecursive() +92<BR> System.Web.UI.Control.LoadRecursive() +92<BR> System.Web.UI.Page.ProcessRequestMain() +724<BR><BR> <BR>That is a weird error, I use the ampersand in c# code all the time without a problem. There is no escape characters for &, c# should just ignore it. Try putting a @ in front of the string, this should make it a verbatim string..Yeah its crazy, i just got it fixed though I wussed out and used %26 instead of & and that corrected the problem. Very crazy, ill try what you recommended though.<BR><BR>Thanks.
 
Back
Top