I want to post a form on html and process the variables with asp.net code, like writing a php code. do I have to use <% %> or can I create an empty file with
我想在html上发布一个表单并使用asp.net代码处理变量,比如编写一个php代码。我必须使用<%%>,还是可以创建一个空文件
<script runat=server>
</script>
1 个解决方案
#1
1
You just need to get the postback values using the Request.Form.
您只需要使用Request.Form获取回发值。
This exposes all the input values in properties.
这会公开属性中的所有输入值。
Look at this:
看这个:
If you have an iput with id "name", you can read the user input like so:
如果你有一个id为“name”的iput,你可以像这样阅读用户输入:
Request.Form["name"]
The result is always a string, so that you'll need to parse it to convert it to another data type.
结果始终是一个字符串,因此您需要解析它以将其转换为另一种数据类型。
#1
1
You just need to get the postback values using the Request.Form.
您只需要使用Request.Form获取回发值。
This exposes all the input values in properties.
这会公开属性中的所有输入值。
Look at this:
看这个:
If you have an iput with id "name", you can read the user input like so:
如果你有一个id为“name”的iput,你可以像这样阅读用户输入:
Request.Form["name"]
The result is always a string, so that you'll need to parse it to convert it to another data type.
结果始终是一个字符串,因此您需要解析它以将其转换为另一种数据类型。