0

Ok, I've been bugging with this for too long.

I need to call my website from a rough VB.net app. Then only thing I need is to attach a query string parameter to the calling url, so I can distinguish the pages to be shown to different VB app users.

So I want to click a button and launch that website, giving this parameter.

First I was bugging with adding the system.web libraries. Now I can't use Request/Response.QueryString as well.

I tried getting some example help from this post. but as I said before - I cannot make use of Request.QueryString as I cannot import it. I am stuck here:

Process.Start("http://localhost:56093/WebSite1?id=")

I need to attach a query string parameter to the url and then open the website with that url. Can someone just give me a sample code for my problem.

3
  • System.Diagnostics.Process.Start("website.com"). Try this. I hope this will help you. Commented Aug 26, 2013 at 10:34
  • @UpvoteMarkAnswer - yeah, but I need to attach a query string parameter to the url. And how to do that? Commented Aug 26, 2013 at 10:36
  • localhost:56093/Website1.aspx?id=somevalue.. for multiple query strings use ampersand Commented Aug 26, 2013 at 10:38

1 Answer 1

3

Query parameters are parsed by the web server/http handler off the URL you use to call the page. They consist of key and value pairs that come at the end of the URL. Your code is nearly there. Say you needed to pass through the parameters:

ID = 1234
Page = 2
Display = Portrait

Then you'd turn them into a URL like this:

http://localhost:56093/WebSite1?ID=1234&Page=2&Display=Portrait

Therefore in your code you'd have:

Process.Start("http://localhost:56093/WebSite1?ID=1234&Page=2&Display=Portrait");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.