简体   繁体   中英

How to get a post value in VB.Net

I need help with getting a Value posted from a form in VB.Net.

At the moment there is a form on a php website that is posting 2 values through to me.

name=Max
email=test"test.com

If i was using php i would use :

$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

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..

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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