Forum Moderators: open
When the form loads the textbox already has a value "test" how lets assume I was sending the query to example.com and adding the?q=test to the url...
www.example.com?q=test
I am using the following code...
Private Sub LinkLabel3_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel3.LinkClickedSystem.Diagnostics.Process.Start("http://www.example.com?q=(txtbox1.text)")
End Sub
I appear to have my syntax wrong, any suggestions.
When clicked it opens http://www.example.com?q=(txtbox1.text)
Thanks in advance.
Mack.
I am pretty new to vb.net to a little yellow when it comes to it. :)
Should I store the value of my query in an array then add it to the end of the url.
The url will always be the same so that part can be hard coded into the app, the only part that will change will be the query. The query will be extracted from the textbox.
Mack.
Private Sub LinkLabel3_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel3.LinkClickedSystem.Diagnostics.Process.Start("http://www.example.com?q=" & txtbox1.Text)
End Sub
Thanks again :)
Mack.
array a bit over the top -unles you have another reason
try
System.Diagnostics.Process.Start("http://www.example.com?q=" & txtbox1.text)
of course you could also use, hopefully
varNew="http://www.example.com?q=" & txtbox1.text
System.Diagnostics.Process.Start (varNew)
you also need a check to see if txtbox1.text is empty
ASP man myself but very close enough to vb.net!
then you should be able to read the variable on the next page by using request.querystring.
hope that helps