views:

56

answers:

2

hey people hope all is well..

i am trying to create a form in VS using ASP that when upon submitting a form the details will get automatically stored in an xml file which can be accessed later on a chosen file save path

i have 2 files ... "Contact.aspx" and "Contact.aspx.vb"

i have created the form in the "Contact.aspx" and when trying to enter the fields in the "contact.aspx.vb" i keep getting several errors such as for example...

Error 5 'Formatting' is not a member of 'System.Web.UI.WebControls.XmlBuilder'

Error 6 'WriteStartDocument' is not a member of 'System.Web.UI.WebControls.XmlBuilder'.

Error 7 'WriteComment' is not a member of 'System.Web.UI.WebControls.XmlBuilder'.

Error 8 'WriteStartElement' is not a member of 'System.Web.UI.WebControls.XmlBuilder'.

Error 10 'WriteAttributeString' is not a member of 'System.Web.UI.WebControls.XmlBuilder'.

there is like 30 errors in total... im literally stuck out my head been trying for 2 days now and can't grasp what im doing wrong ive tried even some of the tutorials online but loads of errors...

hope some1 can fix this

thank you

A: 

It looks like you are trying to use an XMLWriter. The XMLWriter class lives in the System.Xml namespace. Try importing (or using) that and give it another try:

VB:

Imports System.XML

C#:

using System.XML;

Example code:

XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.IndentChars = ("    ");
using (XmlWriter writer = XmlWriter.Create("books.xml", settings))
{
    // Write XML data.
    writer.WriteStartElement("book");
    writer.WriteElementString("price", "19.95");
    writer.WriteEndElement();
    writer.Flush();
}
camainc
A: 

I FOUND ANOTHER WAY TO DO IT :D THANKS THOUGH!