This is my first asp.net page, apologies for poor code structure, etc.
All I want to do is ask the user for their name, and then store that name in a text file. I got this to run in Visual Web Developer 2008, and it stored the name in the text file as expected. When I put the same code on an IIS server, I got this error: "HRESULT: 0x800A004C (CTL_E_PATHNOTFOUND)"
Looking through event viewer, IIS logs, etc does not answer the question at hand -- what path? Where should I expect the file to be saved? Or, is there some method I should use to indicate where the file is to be saved?
Clues would be GREATLY appreciated.
All I want to do is ask the user for their name, and then store that name in a text file. I got this to run in Visual Web Developer 2008, and it stored the name in the text file as expected. When I put the same code on an IIS server, I got this error: "HRESULT: 0x800A004C (CTL_E_PATHNOTFOUND)"
Looking through event viewer, IIS logs, etc does not answer the question at hand -- what path? Where should I expect the file to be saved? Or, is there some method I should use to indicate where the file is to be saved?
Clues would be GREATLY appreciated.
VB.NET:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Label1.Text = TextBox1.Text & ", welcome to the test web!"
Dim objFSO, objTextFile As Object
Const ForAppending As Integer = 8
objFSO = CreateObject("Scripting.FileSystemObject")
objTextFile = objFSO.OpenTextFile("guestbook.txt", ForAppending, True)
objTextFile.WriteLine(TextBox1.Text)
objTextFile.Close()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>Welcome to the test web server!</h1><br />
<br />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Submit"
onclick="Button1_Click" />
<br />
<asp:Label ID="Label1" runat="server" Text="Please type your name in the box above and press Submit."></asp:Label>
</div>
</form>
</body>
</html>