Posting from application to ASP Page

ZeroEffect

Junior Contributor
Joined
Oct 24, 2004
Messages
204
Location
Detroit, MI
I have an application that I need to modify to do the following.

Take data from a source and post it to an ASP script.

the HTML on a web page would look like this.

<HEAD>

</HEAD>

<BODY>

<form action="http://website.net/zfmw/123/datapost.asp" method="POST">

ID: <input type="text" name="ID" value="1234"><br>

Data 1: <input type="text" name="item1" value="Data 1"><br>

Data 2: <input type="text" name="item2" value="Data 2"><br>

<input type="submit" name="submit">

</form>

</BODY>

</HTML>

I have the data all ready split and assigned in my app but how would I go about using this line.

<form action="http://website.net/zfmw/123/datapost.asp" method="POST">

I have been hunting for some examples and such but no real luck.

Any thoughts?

Thanks for any help you may be able to give me.

ZeroEffect
 
Update

I found an example using WebClient and all it does is time out on me. Here is the code I'm using

Visual Basic:
        Dim WebClient As New System.Net.WebClient
        Dim ParamColl As New System.Collections.Specialized.NameValueCollection
        ParamColl.Add("ID", "NowPlaying")
        ParamColl.Add("Artist", "Mother Love Bone")
        ParamColl.Add("Title", "Chloe Dancer")
        TextBox1.Text = "Collection Created" & vbCrLf

        Try
            Dim WebClientResponse As Byte()
            WebClientResponse = WebClient.UploadValues("http://media.radcity.net/zfmw/nowplayingpost.asp", "POST", ParamColl)
            TextBox1.Text = TextBox1.Text & System.Text.Encoding.ASCII.GetString(WebClientResponse)
        Catch ex As Exception
            TextBox1.Text = ex.ToString
        End Try

Any Thoughts, If I build a webpage and post the data that way eveything seems to work fine. Or is there a better way.

Thanks

ZeroEffect
 
OK I have the code above posting to the site but I have timeout when waiting for a response. I really don't need a response I just want to post the data. All I am doing is remotly loading data into a data base where the information in that data base is pulled when a user loads the webpage. Is there a way to kill the response in webclient?

Thanks

ZeroEffect
 
You're mixing languages - it's highly NOT recommended to mix asp.net with asp. If you were to do this, you need to strongly name your dll and install it on the remote server then create an instance of the object in your asp page: Server.CreateObject("YOURDLLNAME") - and that's if I recall the hack I saw out there somewhere correctly....and that's exactly what it is, a hack. Please, do yourself, and anyone who has to maintain this a favor; don't mix classic asp with .NET!
 
I'm not sure how I am mixing ASP.Net and ASP? I'm building a VB.NET App that "Post" data (ID=Value x 3) to an ASP url/script. May be I wasn't clear on what I was trying to do.

Well I found a class that someone else but using HttpWebRequest and everything is working great. I am going throught it to see how it works and what I was doing wrong. I was close I had a couple of things that were off. One was how I was building the ParamColl, so all is well with my application.

Thanks

ZeroEffect
 
Back
Top