Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Link to Google

Link to Google

Scheduled Pinned Locked Moved WPF
csharphelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mark_w_
    wrote on last edited by
    #1

    Hi, I am new to silverlight, and have a little problem! I basically want to have a button and a textbox, and when the user presses the button it links to google and does a search on the text in the text box, so it calls "www.google.co.uk/search?q=" + TextBoxText The problem is when i put somthing like c# in the textbox, the # gets ignored. Mark

    P 1 Reply Last reply
    0
    • M mark_w_

      Hi, I am new to silverlight, and have a little problem! I basically want to have a button and a textbox, and when the user presses the button it links to google and does a search on the text in the text box, so it calls "www.google.co.uk/search?q=" + TextBoxText The problem is when i put somthing like c# in the textbox, the # gets ignored. Mark

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      The problem here is that your querystring text is actually malformed. C# is actually c%23 as far as a querystring goes. What you need to do is UrlEncode the text - you can use HttpUtility.UrlEncode(TextBoxText); to encode it (needs a reference to System.Web).

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

      My blog | My articles | MoXAML PowerToys | Onyx

      M 1 Reply Last reply
      0
      • P Pete OHanlon

        The problem here is that your querystring text is actually malformed. C# is actually c%23 as far as a querystring goes. What you need to do is UrlEncode the text - you can use HttpUtility.UrlEncode(TextBoxText); to encode it (needs a reference to System.Web).

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

        My blog | My articles | MoXAML PowerToys | Onyx

        M Offline
        M Offline
        mark_w_
        wrote on last edited by
        #3

        Thanks :D

        P 1 Reply Last reply
        0
        • M mark_w_

          Thanks :D

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          You are welcome. :)

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

          My blog | My articles | MoXAML PowerToys | Onyx

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups