简体   繁体   中英

VB.NET pas textbox value in windows form to textbox in ASP page

I currently develop a POS system with VB.NET 2017. In the form I work on (called frmProcessCheckOut), I have a textbox where the user enters the amount to charge on Visa. I have an ASP page that has a textfield as well. Is there a way to have a button on the windows form that when I click on it, it puts the value of the textbox in the textfield of the ASP page?

Thank you.

I would do it this way.

1) In Button Click Event , I will trigger the Internet Explorer process as the same time opening my website URL and passing the text value into web parameter, ex. refID

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Process.Start("C:\Program Files\Internet Explorer\iexplore.exe", "http://mywebsite.com?refID=" & TextBox1.Text)
End Sub

2) Inside the ASPX page Load Event , you can read Page Request and do your needed actions to it.

If Request("refID") = Nothing Then
   'You didn't pass any values, or TextBox1.text was empty.
Else
   'TextBox1 has some text, do some actions.
End If

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