简体   繁体   English

如何在VB.Net中获得职位价值

[英]How to get a post value in VB.Net

I need help with getting a Value posted from a form in VB.Net. 我需要帮助从VB.Net的表单中发布值。

At the moment there is a form on a php website that is posting 2 values through to me. 目前在php网站上有一个表单,它向我发布了2个值。

name=Max
email=test"test.com

If i was using php i would use : 如果我使用的是php,我会使用:

$name = $_POST['name'];
$email = $_POST['email'];

Now the above fields are now captured within a variable. 现在,以上字段现在捕获在变量中。

How do i do the the same thing in VB.NET 我如何在VB.NET中做同样的事情

I cannot tell if you are referring to Web text box's or PHP forms but I can help you with Web text box's.. 我无法确定您是指Web文本框还是PHP表单,但可以为您提供Web文本框的帮助。

Your question is unclear, but I will try my best. 您的问题尚不清楚,但我会尽力而为。 Assuming you want to get a textbox's value into a variable. 假设您想将文本框的值转换为变量。 You would do like so: 您会这​​样做:

Example Textbox: 示例文本框:

<asp:TextBox ID="ExampleTxtBox" runat="server" AutoPostBack="True"></asp:TextBox>

If you want to assign the values on a certain command, for example, a button click. 例如,如果要在某个命令上分配值,请单击按钮。 You would put this into the button click handles of the button. 您可以将其放入按钮的按钮单击句柄中。

Assuming you want to get the current text/value from the form's text box: 假设您要从表单的文本框中获取当前文本/值:

    Dim VariableOfTextBox As String 'Creates your Variable
    VariableOfTextBox = ExampleTxtBox.text 'Assigns the Value from your Text Box

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM