capturing http post values using asp.net

GeX

GeX

Soldato
Joined
17 Dec 2002
Posts
6,982
Location
Manchester
Hi all.. me again..

I want to send a few basic string variables from via http post to an asp.net page, the asp.net page can then save them to the server.

Working with asp.net is all new to me, and I cannot get my head round how to do it. Can anyone point in the right direction?

edit;

now i just feel stupid, no coding before coffee from now. I feel like i've just asked how to suck eggs
 
Last edited:
yeah, this does it fine using get

Code:
<%@ Import Namespace="System.IO" %>
<script Language="VB" Option="Explicit" runat="server">

	Sub Page_Load(Src as object, E as EventArgs)
        If Request.QueryString("Text") <> "" Then
            Dim FILENAME As String = Server.MapPath("Output.txt")
            Dim objStreamWriter As StreamWriter
            objStreamWriter = File.AppendText(FILENAME)
            objStreamWriter.WriteLine(Request.QueryString("Text"))
            objStreamWriter.Close()
    
        End If

    End Sub

</script>
 
Back
Top Bottom