无法从VB检索表单值

时间:2021-08-24 22:23:43

I've created a module for my website and when a button is clicked, it calls a VB sub on the server.

我已经为我的网站创建了一个模块,当点击一个按钮时,它会调用服务器上的VB子。

I need this sub to retrieve the values that were filled in on the form, but the things I need to retrieve values from are not asp controls, they are simple <input> and <select> tags.

我需要这个子来检索表单上填充的值,但是我需要检索值的东西不是asp控件,它们是简单的

How can I retrieve values from input on a .aspx page from VB code executed behind it?

如何从后面执行的VB代码中检索.aspx页面上的输入值?

3 个解决方案

#1


There you go : http://www.geekpedia.com/KB16_How-do-I-get-the-values-when-submitting-a-form-(either-using-GET-or-POST).html

你去:http://www.geekpedia.com/KB16_How-do-I-get-the-values-when-submitting-a-form-(either-using-GET-or-POST).html

In you sub, you must use the request object. More infos here : http://msdn.microsoft.com/en-us/library/aa231199(VS.60).aspx

在您的sub中,您必须使用请求对象。这里有更多的信息:http://msdn.microsoft.com/en-us/library/aa231199(VS.60).aspx

Hope this help you ;)

希望这能帮到你;)

#2


Your HTML

<input id="firstName" name="firstName />

Your VB.NET

Dim firstName as String = Request.Form("firstName")

#3


Use the Request.Form object for POST. Or the Request.QueryString for GET.

使用Request.Form对象进行POST。或者GET的Request.QueryString。

#1


There you go : http://www.geekpedia.com/KB16_How-do-I-get-the-values-when-submitting-a-form-(either-using-GET-or-POST).html

你去:http://www.geekpedia.com/KB16_How-do-I-get-the-values-when-submitting-a-form-(either-using-GET-or-POST).html

In you sub, you must use the request object. More infos here : http://msdn.microsoft.com/en-us/library/aa231199(VS.60).aspx

在您的sub中,您必须使用请求对象。这里有更多的信息:http://msdn.microsoft.com/en-us/library/aa231199(VS.60).aspx

Hope this help you ;)

希望这能帮到你;)

#2


Your HTML

<input id="firstName" name="firstName />

Your VB.NET

Dim firstName as String = Request.Form("firstName")

#3


Use the Request.Form object for POST. Or the Request.QueryString for GET.

使用Request.Form对象进行POST。或者GET的Request.QueryString。