S
slinky
I've tried this week everything I can think of to get this code to
work , can any kind soul take a look at my code and my what should be
a simple task and help me out. I've looked in books, websites, and
can't find a solution... thanks!
I have an aspx for with a textbox and a button. The goal is to simply
have the user type a message, hit the button and it should append to
the XML file. I can open the aspx in the browser with no problem, but
the XML file does not get updated. What's wrong with this code?
Thanks!
<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim ds As New DataSet()
ds.ReadXml(Server.MapPath("timeline.xml"))
txtNewEvent.DataBind()
ds.Dispose()
End If
End Sub
Private Sub btnSubmit_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim ds As New DataSet()
Try
ds.ReadXml(Server.MapPath("timeline.xml"))
ds.Tables(0).Rows(0).Item("Event") = txtNewEvent.Text
ds.WriteXml(Server.MapPath("timeline.xml"))
Catch
Finally
ds.Dispose()
End Try
End Sub
</script>
work , can any kind soul take a look at my code and my what should be
a simple task and help me out. I've looked in books, websites, and
can't find a solution... thanks!
I have an aspx for with a textbox and a button. The goal is to simply
have the user type a message, hit the button and it should append to
the XML file. I can open the aspx in the browser with no problem, but
the XML file does not get updated. What's wrong with this code?
Thanks!
<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim ds As New DataSet()
ds.ReadXml(Server.MapPath("timeline.xml"))
txtNewEvent.DataBind()
ds.Dispose()
End If
End Sub
Private Sub btnSubmit_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim ds As New DataSet()
Try
ds.ReadXml(Server.MapPath("timeline.xml"))
ds.Tables(0).Rows(0).Item("Event") = txtNewEvent.Text
ds.WriteXml(Server.MapPath("timeline.xml"))
Catch
Finally
ds.Dispose()
End Try
End Sub
</script>