在ASP.NET POST方法检索数据 [英] Retrieving data from a POST method in ASP.NET

查看:192
本文介绍了在ASP.NET POST方法检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ASP.NET。

I am using ASP.NET.

有一个需要POST数据到我的网站系统和所有他们要求由我来为他们提供一个网址。
所以我给了他们我的网址 http://www.example.com/Test.aspx

There is a system that needs to POST data to my site and all they asked for is for me to provide them with a URL. So I gave them my URL http://www.example.com/Test.aspx.

现在我并不确切他们是如何将它张贴,但现在知道我Test.aspx的页面上我需要写code,将这些数据保存到数据库中。

Now I do not know exactly how they POST it but now on my Test.aspx page I need to write code that will save that data to a database.

但如何将这项工作,我必须将Test.aspx的页面上做什么?

But how would this work and what must I do on my Test.aspx page?

我写在我的页面加载事件的一些code发送给我一个电子邮件页面加载,看看他们是否实际上打的页面,它似乎并不像他们甚至?

I wrote some code in my Page Load Event that sends me an email on Page Load to see if they actually hit the page and it does not seem like they are even?

推荐答案

您可以用code类同这(C#)发布到页面的表单值 -

You can get a form value posted to a page using code similiar to this (C#) -

string formValue;
if (!string.IsNullOrEmpty(Request.Form["txtFormValue"]))
{
  formValue= Request.Form["txtFormValue"];
}

或本(VB)

Dim formValue As String
If Not String.IsNullOrEmpty(Request.Form("txtFormValue")) Then
    formValue = Request.Form("txtFormValue")
End If

一旦你的价值,你需要,那么你可以构造一个SQL语句,以及将数据写入到数据库。

Once you have the values you need you can then construct a SQL statement and and write the data to a database.

这篇关于在ASP.NET POST方法检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆