A
Aaron
Hello,
I am using VB/ASP.net 2005. When I click submit it refreshes the page
without entering the data from all the text boxes and not entering in the
Game1.xml.
here is the asp.vb code
Imports System.Xml
Partial Class _game1
Inherits Web.UI.Page
...............
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
Dim xDoc As New XmlDocument
xDoc.Load(Request.MapPath("game1.xml"))
Dim newComment As XmlDocumentFragment = xDoc.CreateDocumentFragment()
newComment.InnerXml = "<Game>" + _
"<Wname>" + Server.HtmlEncode(txtWName.Text) + "</Wname>" + _
"<Bname>" + Server.HtmlEncode(txtBName.Text) + "</Bname>" + _
"<date>" + Server.HtmlEncode(txtDate.Text) + "</date>" + _
"<opening>" + Server.HtmlEncode(txtOpening.Text) + "</opening>" + _
...........
...........
...........
"</Game>"
Dim root As XmlElement = xDoc.DocumentElement
root.AppendChild(newComment)
xDoc.Save(Request.MapPath("game1.xml"))
Response.Redirect(".....")
End Sub
.........
End Class
TIA
I am using VB/ASP.net 2005. When I click submit it refreshes the page
without entering the data from all the text boxes and not entering in the
Game1.xml.
here is the asp.vb code
Imports System.Xml
Partial Class _game1
Inherits Web.UI.Page
...............
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
Dim xDoc As New XmlDocument
xDoc.Load(Request.MapPath("game1.xml"))
Dim newComment As XmlDocumentFragment = xDoc.CreateDocumentFragment()
newComment.InnerXml = "<Game>" + _
"<Wname>" + Server.HtmlEncode(txtWName.Text) + "</Wname>" + _
"<Bname>" + Server.HtmlEncode(txtBName.Text) + "</Bname>" + _
"<date>" + Server.HtmlEncode(txtDate.Text) + "</date>" + _
"<opening>" + Server.HtmlEncode(txtOpening.Text) + "</opening>" + _
...........
...........
...........
"</Game>"
Dim root As XmlElement = xDoc.DocumentElement
root.AppendChild(newComment)
xDoc.Save(Request.MapPath("game1.xml"))
Response.Redirect(".....")
End Sub
.........
End Class
TIA