This project is read-only.

Footer Text Problem

Topics: Developer Forum, User Forum
May 6, 2008 at 9:06 PM
When I add a <br> in the footer text tag so that I can add multiple lines to my footer such as this:

<?xml version="1.0"?>
<WebSiteData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<HomepageId>49e410b5-d248-4dde-96fb-6964bf342a3d</HomepageId>
<Theme>CAC Theme</Theme>
<Language>en-GB</Language>
<SmtpServer>smtpout.secureserver.net</SmtpServer>
<SmtpUser>webmaster@childrensacutecare.com</SmtpUser>
<SmtpPassword>cac408</SmtpPassword>
<SmtpDomain />
<FooterText>Copywrite 2008 - Children's Acute Care<br>653 Town Center Dr</br></FooterText>
<WebSiteTitle />
<Keywords />
<Description />
<EnableSectionRss>true</EnableSectionRss>
<MailSenderAddress>webmaster@childrensacutecare.com</MailSenderAddress>
</WebSiteData>

I get the following error when I try to view the page. is there any way of adding lines to the footer so I dont have this problem?

Unexpected node type Element. ReadElementString method can only be called on elements with simple or empty content. Line 10, position 54.
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.

Exception Details: System.Xml.XmlException: Unexpected node type Element. ReadElementString method can only be called on elements with simple or empty content. Line 10, position 54.

Source Error:


Line 10: } catch (Exception ex)
Line 11: {
Line 12: throw ex;
Line 13: }
Line 14: }


Source File: c:\Documents and Settings\Jason Meyer\My Documents\CAC Website 05-02-08\Global.asax Line: 12

Stack Trace:


XmlException: Unexpected node type Element. ReadElementString method can only be called on elements with simple or empty content. Line 10, position 54.
System.Xml.XmlReader.ReadElementString() +1934465
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderWebSiteData.Read2_WebSiteData(Boolean isNullable, Boolean checkType) +922
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderWebSiteData.Read3_WebSiteData() +76

InvalidOperationException: There is an error in XML document (10, 54).
ASP.globalasax.ApplicationStart(Object sender, EventArgs e) in c:\Documents and Settings\Jason Meyer\My Documents\CAC Website 05-02-08\Global.asax:12




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
May 8, 2008 at 7:46 PM
Hi
Where do you add the break? The .xml shouldn't contain <> since this will make the xml fail on render. In Website.aspx you can add the line with a <br/> tag. It's then rendered as <br>.
In XHTML theres no tag <br>. It should be <br/>
May 8, 2008 at 9:57 PM
Edited May 8, 2008 at 9:58 PM
I was doing it in the website.config page and thats where I was getting the problem. lIke most things if I screw around with it long enough I will eventually figure it out. what I figured out is I didnt need to go to the code to make the change I could enter the <br> right on the field in the CMS Setup page and it would render the following <br> in the website.config file.

Final lesson learned here is that I dont know nearly enough about ASP.net and absolutely nothing about C# which I think is what <br> is, and had I known that it wouldnt have taken so long to figure out.

I have a lot to learn about all of this still.
May 18, 2008 at 7:26 PM
Big smile :-) I was there a while ago, and I'm still learing. I know that this is not easy to understand, but you'll get there, I promise you.
May 19, 2008 at 11:18 PM
I was able to change the footer...in /App-Code/WebSiteFooter.cs, I added following (bold) codes to put 2 links (home and contact) 1 line before the footer message.

 

public class WebSiteFooter : Control

 

{

 

public WebSiteFooter() { }

 

 

protected override void Render(HtmlTextWriter writer)

 

{

 

string s="<a href='default.aspx'>home</a>&nbsp;|&nbsp<a href='contact.aspx'>contact</a><br />";

 

writer.Write(s);

writer.Write(

WebSite.GetInstance().FooterText);

 

}

}

You can see 2 lines in my site  http://www.leleAdelee.com/ , scroll down to the footer.
J.

May 19, 2008 at 11:32 PM
Sorry, it was in App-Code/Controls/WebSiteFooter.cs, I skipped "Controls" folder in the above post. J.
May 19, 2008 at 11:41 PM
Sorry, it was in App-Code/Controls/WebSiteFooter.cs, I skipped "Controls" folder in the above post. J.
May 20, 2008 at 12:18 AM
Thanks Julia